New to CI - have small question...

#1
[eluser]bookworm[/eluser]
Hello there. I'm trying to choose a suitable framework to use in my projects.
So would you please give me an answer to next question: is it possible in CI to set a controller for any url which doesn't have a controller? Sorry for my English, I'll try to explain...

1. I have a tree structure of pages (site's content)
e.g.
"/mytopic1/mypage1"
"/mytopic1/mypage2"
"/mytopic2/mypage1"
"/mytopic3"
2. I have some content of another type
"/news"
"/polls"

So. I want to have 3 controlles: news.php, votes.php and other_pages.php
The last one is for my content tree.

Is it possible in CI? Is it flexible enough?
Or maybe I should use something like 404-error-controller?

I really don't want to have these urls:
mysqsite.com/pages/mytopic1/mypage1
mysqsite.com/pages/mytopic2/mypage2
mysqsite.com/news
mysqsite.com/votes

I need this style:

mysqsite.com/mytopic1/mypage1
mysqsite.com/mytopic2/mypage2
mysqsite.com/news
mysqsite.com/votes

#2
[eluser]n0xie[/eluser]
You could do this by extending the router class and using the _remap function.

#3
[eluser]bookworm[/eluser]
Thanks a lot. It's hard to make a choice: CMS vs framework. My project (offline magazine's website) should have complex data structures - not only simple pages, but online versions of magazine's articles. Topics, authors, tags... I haven't manage to find CMS which is flexible enough. Even Joomla!

I'll try CI. I think it will be more interesring - to write whole web-application rather than some components to CMS.

Sorry for my english again Smile

#4
[eluser]jedd[/eluser]
It'll certainly be bigger .. and, yeah, probably more interesting (for varying values of Interesting).

Are you sure you can't utilise Joomla or Drupal or Deki/Mindtouch and just bang in extra code for the additional things you need? Most of those have got a huge set of funky add-ins already, so you might find people have already got those products doing what you want.

Writing a CMS from scratch is a mammoth job, to be sure.

You might also want to, if you are set on writing a custom one, take something like [url="http://github.com/philsturgeon/pyrocms"]pyrocms[/url] and contributing plugins to that, to get where you want to go.

#5
[eluser]bookworm[/eluser]
Actually, I'm not interested in user-friendly CMS with WYSIWYG editors etc. (Talking about administrator's interfaces.)
On the other hand, some content is going to be very complicated and I'm scared about the situation when I won't be able to create plugin/component for chosen CMS. But If I'll write CI-based code, I'll be sure - what functions are possible to add to my website.

Also there is a huge quantity of content to be moved to new system (website). If I choose wrong CMS... it will be labour of Sisyphus

But I'm still thinking... Smile
Thank you!

#6
[eluser]jedd[/eluser]
[quote author="bookworm" date="1252356911"]Actually, I'm not interested in user-friendly CMS with WYSIWYG editors etc. (Talking about administrator's interfaces.)[/quote]

On the other hand, your users are probably very keen on a friendly system .. and writing one of those is much more difficult than a technically sound (but user-unfriendly) system.

Quote:On the other hand, some content is going to be very complicated and I'm scared about the situation when I won't be able to create plugin/component for chosen CMS. But If I'll write CI-based code, I'll be sure - what functions are possible to add to my website.

I can see the concern - and it becomes a trade-off there for learning the ins and outs of the given CMS (and the contrib section of its respective web site) so you can write add-ons for it, versus the effort of writing a fully system from scratch and still having to write add-ons for it.

At the moment, if you're keen on a CI-based system (I'm not sure of the architecture of other popular, non-EE CMS) I'd really recommend you spend some time looking through pyroCMS (as per the above URL) - it's simple to grab the source using git, and check through both the architecture and the change history to get an idea of what's involved in writing a CI-based CMS. And, as I say, it might make a perfect candidate for you to base your work around, and just contribute features and modules to.

#7
[eluser]BrianDHall[/eluser]
As to the thread topic, one other thing to look at is URI Routing documentation if you haven't already.

You can use hard-coded regular expressions, or more extensive if/then nested processing right in the routing file itself.

As to your feeling, I personally love CI for much a similar reason to you - I started a job a few months ago where months of work had been done in Joomla, and it ended up being that it really wasn't a very smart decision as most of the core functionality wasn't in Joomla, and the extensions/modules/plugins made it a terribly difficult job. I redid it all in pure php in about 1 really long week, then redid that job in codeigniter in just 3 reasonable days.

I don't regret the framework decision, nor the one to avoid using a CMS. I keep considering checking out PyrmoCMS or ExpressionsEngine, but I have had such bad experiences trying to use systems like Magento (boo! hiss!), Joomla, osCommerce, etc - I just want to do my work and be done with it!

So when new things came in like special subscription membership offers, a new payment processor with their own XML-API they required you to use to contact them, SEO optimization, restructuring of membership permissions ("let's let Merchants access these member features..."), custom printing pages, and on and on - there is no fear of being stuck, because CI is as flexible as PHP itelf. I have found no greater rigidity, and everything it does just works.

Quite a few times I worked for days, even weeks, building some custom features (like special Encryption handling, curl connections, xml processing, etc)...only to find that CI had a library for that and suddenly it was done in a few hours. But when there hasn't been or I didn't like what was out there (I prefer to write my own authentication, for instance)...it was as easy as writing code. No manuals to check, no API specs to read through, no desktop book needed - just get to work.

I can't endorse CI more strongly, though I do highly recommend you use an ORM add-on like DataMapper Overzealous Extension or IgnitedRecord, etc.

#8
[eluser]bookworm[/eluser]
Thank you everybody. I'll try to make right choice.

I'm not against using libraries. I just need maximum of flexibility.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.