Forum Moderators: coopster

Message Too Old, No Replies

PHP frameworks & Model View Controler

who uses them? Tell us about it

         

pixeltierra

6:31 am on Nov 22, 2006 (gmt 0)

10+ Year Member



After 4 or so years developing applications, I'm starting to consider abandoning my "personal" way of doing things, and my personal script libraries, in favor of more convention-based approaches, like frameworks (I haven't yet found a content management system I can tolerate)

I've spent the last week reading Code Ignitor's manual and my head is kind of reeling. I've also tried to plod into Cake PHP's manual and now my head is pounding.

What php frameworks have you all found effective and why?

For those with experience with the MVC approach, do you think that this really makes sense for web dev?

henry0

12:41 pm on Nov 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is an interesting question, but is there an answer leading to something positive?
I always include my own CMS with every site built
but it requires to modify my system in order to fit each new site.
As such my point is: Could any framework be “one size fits all”?
(I could be shooting in the dark for I never used any framework)

pixeltierra

6:20 pm on Nov 22, 2006 (gmt 0)

10+ Year Member



Frameworks are like standardized tool boxes filled with tools you can use. In terms of a CMS, a framework is something you might build a CMS with.

nmweb

11:35 pm on Nov 23, 2006 (gmt 0)

10+ Year Member



I've been using CodeIgniter for a while now and it completely suits my purposes. I was set back from php for a while because it does not give you clear structures to work with. Not being a professional programmer and only having temporary obsessions with websitebuilding I felt that using PHP would in my case lead to weird, unreadable spaghetticode, and it did. Although the applications were quite advanced they were hell to maintain and extend.

Using a framework like CI brought back the initial enthusiasm I had for programming, and, even though I am a hobbyist, it made me use clearly laid out structures. Separation of logic,presentation and data retrieval made it much easier for me. It simply enabled me to build bigger and more complex websites in and I am able to do it faster as well.

I have the same objection to CMS'es as you do, they never quite fit my purposes. Difficulty to extend, tied to a restricting structure, unable to unleash my creativity and in the end always resorting to nasy hacks. Using a framework allowed me to keep the occasional creative outbursts with the opportunity of building a CMS quick and tailormade.

It sounds a bit like a commercial but I really find programming fun now, you don't have to focus on the details but instead simply make the application. So much is just already done, security, database abstraction, form validation, image manipulation, CRUD, scaffolding, table relations, file uploads, stuff I either had to build myself (and I have) or search for on the internet to find some properly programmed class to do it for me.

The choice of frameworks is more personal, I think. I took CI because of its flexibility, speed, its simple implementation and great documentation. CakePHP would probably have done as well though its documentation isn't as good, I hear. Symphony is for php5 which is presently not installed on my server (it looks very promising though, good documentation too).

PEAR is not really a framework although it takes away some work for you with its many classes. Documentation simply sucks and the classes are often bulky and less often buggy.

Zend framework is supposed to be lean and good, simply focussing on the MVC. I haven't tried it or seen screenshots/tutorials or anything so I don't know much about it.

I know of Symphony and Cake that they have advanced AJAX classes, I miss this in CI although I don't need it for the website I'm working on right now. It is relatively easy to implement a similar solution for CI and the community is working on it, so that shouldn't keep you.

I hope I cleared things up for you.

pixeltierra

5:49 am on Nov 25, 2006 (gmt 0)

10+ Year Member



nmweb: Welcome to WebmasterWorld!

Thanks for your post, and your input. I appreciate it a lot.

I personally came to computers through an interest in web dev and not as a programmer orignially. So even though I could write code to do just about anything I wanted, I found I had a lot to learn about readability, extensibility, upgradability, and working on teams (which I don't do really).

I can see you've looked into the issue more than I have. CakePHP's documentation is confusing and limited and cursory at best. It seems to do the same things CI does, just not as intuitively and more restrictively. I've also looked at Drupal (CMS) and it seems very flexible and a possible candidate for certain projects. I've looked at Joomla and was appalled by the crappy unstandard table-filled html code it produces, but like the user management aspects.

I hadn't heard of Zend Framework (But I have heard of Zend). I thought it was an IDE. I'll check it out. Thanks for the tip. I'll also look into PEAR. This is code repository, right?

Cake's AJAX library seems very cool, but it wouldn' be hard to write my own and integrate it into CI. But if they're working on one, maybe I'll wait : ) That's one of the benefits I'm trying to plug into by using a popular framework that is updated frequently, upgrading it with increasingly better functionality. Also, it saves me from writing a code guide for people who work on the same projects with me. I just send them to CI's manual. Have you found any MVC frameworks that you like better than CI?

What I don't get in CI, is what to do with regular static pages that aren't exactly "applications". A site might have many forms or whatever, but not all pages are dynamic, as CI's manual shows perfectly. It would be silly to have a controller for each page. I guess I can make a controller for static pages called "pages" or something, and pass it the name of a "view", but a static page isn't really a view, though.

pixeltierra

6:17 am on Nov 25, 2006 (gmt 0)

10+ Year Member



I've just checked out Zend Framework and it looks VERY thorough. Unfortunately, it looks VERY hard to penetrate, and although it has a thorough reference manual online, it does NO JOB AT ALL (not even a bad job) getting your oriented and overviewed and started working with the system. I gave up after a half hour. They should remedy that.

nmweb

11:15 am on Nov 25, 2006 (gmt 0)

10+ Year Member



What I don't get in CI, is what to do with regular static pages that aren't exactly "applications". A site might have many forms or whatever, but not all pages are dynamic, as CI's manual shows perfectly. It would be silly to have a controller for each page. I guess I can make a controller for static pages called "pages" or something, and pass it the name of a "view", but a static page isn't really a view, though.

You can have normal static pages residing besides your index.php in the root folder. A proper .htaccess file should recognize its existence and not use the CI way of doing things. I myself would use a controller for static pages, the layout is set using templates and bypassing CI for this would make the application lose its structure.

If the URL becomes ugly because you have an unnecessary controler you can use the routing function to make it look good.

My experience is mainly with CI, as said it has good documentation, easy learning curve and does not enforce its own structure upon me too much (unlike most CMSes). The next best candidate would be Symphony, again good documentation, community but php5 only. (Yahoo uses it :) )

I heard recently of Seagull framework, but I don't know much about it.

pixeltierra

7:14 pm on Nov 25, 2006 (gmt 0)

10+ Year Member



You can have normal static pages residing besides your index.php in the root folder. A proper .htaccess file should recognize its existence and not use the CI way of doing things. I myself would use a controller for static pages, the layout is set using templates and bypassing CI for this would make the application lose its structure.

Yea, it won't only loose it's structure, but you won't be able to benefit from the built in classes or helpers.