Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

Best current framework: Opinions..

Recommended Posts

For awhile now I have gained some pretty decent experience using various frameworks.  I used zend awhile..it's decent but not what I was looking for.

The 2 I enjoyed using the most were cakePHP and Codeigniter.  I started using CakePHP on my main paying project...and code igniter for pretty much all of my own personal/freelance projects.

The thing is I always noticed that cake may take a few more minutes to get setup...I like it a lot more once things get rolling properly.

Here is my..problem.  I "Like" Code Igniter.  But there are some things I don't like about it.  I practically Love cakephp.  The problem is CakePHP has recently developed a new release that is heavily altered from the original version.  I am lost with the new version because of the way it works.  Was there any documentation updates.  There are things in the cakephp new release that make no sense to me (especially all of the test folders and everything).

 

Share this post


Link to post
Share on other sites

I think it always depends. The reason I don't generally use pre-built frameworks is because nothing generally does what I want it to.

 

Funny enough, my main focus in PHP is writing things you'll never see. I don't like writing HTML, or care much about the Web in general. Most of my work in PHP is related to systems integration via SOAP, Sockets, etc, or for generating dynamic reports from a database or files. These are highly dynamic from day to day, so I tend to write code which can be used in that way.

 

If I ever were to focus on writing a 'Web App,' I would probably use a framework like Symphony + Propel. I like the idea of having an ORM tightly coupled with the framework.

 

Share this post


Link to post
Share on other sites

That is a thought.  I have been looking over both Symphony and Zend.  One thing I don't like about zend is no support for PHP 4.  I am working in PHP 5 MOST of the time but there are some projects that don't allow that.  For those..I don't want to have to change back and forth from framework to framework.

It's kind of annoying.  I am not sure about symphony.  I am still taking a look at it and might end up using it.

Share this post


Link to post
Share on other sites

...One thing I don't like about zend is no support for PHP 4...

 

with the imminent release of 5.3 and not long to version 6, this argument seems a bit of a cop-out nowadays. Sure - some hosts still dont support v5, but personally i'd move my hosting if that's the case - with all new stuff people demand from sites, etc, i want a host that's going to move forward with the projects i want hosted.

 

over time, you tend to find good and bad things about all frameworks. the only thing you tend to find is that none of them are actually great for personal requirements unless your requirements are very simple. However - whilst I don't like the complexity of Zend (especially naming conventions, classnames, not to mention many advanced concepts), I do appreciate the fact that, given time, it can be put together to operate to taste - due to the fact that it's more a collection of solid libraries than a cliche'd "framework."

Share this post


Link to post
Share on other sites

It's always good to hear from you.  I haven't heard from you in awhile red.

Thanks for the feedback.

I am just perusing now.  I have gained some "Experience time" with various frameworks.  I am just in a search to find one

that is going to be good for me for general use.  Still using Codeigniter on Personal stuff and Cake on others...I guess just getting itchy to try out some

new ones here and there and see what some of them have to offer.

Share this post


Link to post
Share on other sites

This might be a similiar question but in your opinion which one of these "Frameworks" has more "Features".

Cake php, Codeigniter, Symphony, or Zend?

Share this post


Link to post
Share on other sites

Kohana: kohanaphp.com

 

PHP5+ only, full OOP, light, modular, excellent ORM, uses a more traditional MVC approach.

 

The only drawbacks I see are the documentation which is still a bit lacking (but being improved upon) and that it's still relatively new and not widely known. It was originally a community created fork of Code Igniter, made due to the lack of updates on CI some time ago.

Share this post


Link to post
Share on other sites

Oh and by the way the reason why I was asking about frameworks now in the first place is because I have been using Codeigniter and cake for awhile.  I haven't really tried too many others yet...except zend.  The thing is now that I understand how they work it's getting to where I kind of want to get one that I can use that matches the way I program...one that I like. Now my "Favorite" so far is Codeigniter. I love it..but there is one thing I don't like.  I LOVE cakePHP's templating system.  having one file in layouts that can have a template put into it and then it takes form throughout the whole site.  It's really convenient and makes it REALLY easy when the time comes to be able to change out layouts or have multiple layouts.

That's the thing that code igniter lacks that I really want.  I might just keep using codeigniter but take some time to modify it's codebase so it allows it to function that way in regard to Cakephp.  After that it'll be exactly what I was looking for.  So If I can't find anything I like better then I will just use that..so I get the stuff I like out of code igniter but get the template functionality that I love inside of Cakephp.

 

@Aeglos - I just looked over that framework and to be honest it looks rather nice.  It also looks to be rich in helpers, libraries, and add-ons.  Thanks for the link I think I will give that a try and see how I like it.

Share this post


Link to post
Share on other sites
Now my "Favorite" so far is Codeigniter. I love it..but there is one thing I don't like.  I LOVE cakePHP's templating system.  having one file in layouts that can have a template put into it and then it takes form throughout the whole site.  It's really convenient and makes it REALLY easy when the time comes to be able to change out layouts or have multiple layouts.

That's the thing that code igniter lacks that I really want.

 

Kohana does this effortlesly. Just have your controllers extend the Template_Controller and specify a master template in the constructor, and voilá. On top of that, Kohana's "Views within views" I find brilliant, where you can do this:

 

$page = new View('views/site');
$page->title = 'Test page with lunch menu';
$page->content = new View('views/lunch_menu');
$page->render;

 

It's so absurdly simple and so blatantly obvious it makes really ashamed to never have thought of it... makes me realize how much I still have to learn about OOP  :D

Share this post


Link to post
Share on other sites

I prefer Zend Framework to CI and Cake by far. It might seem a bit more complex at first glance and might have a slightly higher learning curve. I like the freedom it gives you. Don't like a specific component of Zend Framework? Just write your own. You can also easily extend the existing classes.

 

Mark mentioned that he doesn't like ZF's naming convention. I find the naming convention to be excellent. By looking at the name you will always know where it is located. Zend_Form_Element_Password would be in /Zend/Form/Element/Password.php. Also that you can take out the individual components of the framework and use them as libraries as well is pretty good in my opinion.

Share this post


Link to post
Share on other sites

it's not so much the way they're named, but many of them strike me as far too long.

Share this post


Link to post
Share on other sites

I'll go with Zend Framework, it gives me the feeling that it's just organized and well structured. Although I'm a bit ashamed to say that I haven't written bigger things with it. If the documentation left you with doubts, check the API Documentation as some of their descriptions/comments are pretty helpful.

 

I also tried cakePHP and CI, but I'm more inclined to ZF =/ (meaning that I haven't fully used/read the manual or anything)

Share this post


Link to post
Share on other sites

I think I know what I am going to do.  I am just going to continue using cake for the bigger/more professional projects.  When I do personal/small sites I am going to use Codeigniter.  I am starting to move into Java/C++ a lot and working in those areas.  PHP might always be my main language but I intend to slowly shift my primary from Web to Desktop after awhile..and interactive gaming (C++).

Share this post


Link to post
Share on other sites

I wish you luck.

 

There's some great OS Application frameworks I use quite frequently. Will you be focusing on Windows programming?

Share this post


Link to post
Share on other sites

it's not so much the way they're named, but many of them strike me as far too long.

 

I agree, but there's good reason why are that long. With the advent of namespaces, we can finally get rid of that. Even if Zend doesn't release a namespaced version, it won't be that hard to parse the files and modify the code to use namespaces. :)

Share this post


Link to post
Share on other sites

yeah I was thinking what they'd do, actually - considering many of the namespace "examples" use These_Really_Really_Long_Class_Names to demonstrate the benefits. I suppose it's one of the reasons why I've held off on delving further into it with the view of integrating it into my own projects, as I don't fancy doing a hefty restructure/rewrite once (if) the framework gets reworked and upgraded.

Share this post


Link to post
Share on other sites

Now my "Favorite" so far is Codeigniter. I love it..but there is one thing I don't like.  I LOVE cakePHP's templating system.  having one file in layouts that can have a template put into it and then it takes form throughout the whole site.  It's really convenient and makes it REALLY easy when the time comes to be able to change out layouts or have multiple layouts.

That's the thing that code igniter lacks that I really want.

 

Kohana does this effortlesly. Just have your controllers extend the Template_Controller and specify a master template in the constructor, and voilá. On top of that, Kohana's "Views within views" I find brilliant, where you can do this:

 

$page = new View('views/site');
$page->title = 'Test page with lunch menu';
$page->content = new View('views/lunch_menu');
$page->render;

 

It's so absurdly simple and so blatantly obvious it makes really ashamed to never have thought of it... makes me realize how much I still have to learn about OOP  :D

 

My framework works the same way lol

Share this post


Link to post
Share on other sites

 

It would be nice if someone could compile a list of each system's logic flow and/or benchmarks so that people new to these frameworks could have a better understanding before they dive in. I would hate to use CI when Zend or CP was better suited or vis-versa.

 

Also, why are people still talking about PHP4?

PHP5-6 takes less than an hour to fully configure on your own network and I can't even find a host that doesn't have PHP5  ;D

Share this post


Link to post
Share on other sites

It would be nice if someone could compile a list of each system's logic flow and/or benchmarks so that people new to these frameworks could have a better understanding before they dive in. I would hate to use CI when Zend or CP was better suited or vis-versa.

 

thing is - each person's requirements are soooo different that it's very hard to judge what is going to be better. maybe one person's application is not heavy on the database compared to another. maybe one does alot of templating/parsing, etc. the only real way of deciding which framework is good for you is to actually play with it yourself. sometimes it's more about the way you work rather than specific features - ie, i'd rather have a framework that was lacking in "features" but easy to develop for than a fully-fledged framework that's hard to add things to easily, with all common items grouped in one place logically.

Share this post


Link to post
Share on other sites

Here's a question: which package is the best for learning real-world OOP by diving into the source code?  By this, I mean well documented code, with clear, concise classes?

 

I've tried learning by dissecting CI, but it all gets a bit confusing.  Being able to follow the actual process of obtaining and rendering a page in detail (i.e. index.php -> something else.php -> ... -> view.php) would be a great help.  The general flow chart is good, but things get muddled (in my mind's eye, anyway) when trying to match the chart to the actual classes.

 

I just want to be able to sit down with a nice, lightweight bit of PHP 5 framework code to dissect and learn from.

Share this post


Link to post
Share on other sites

Zend would probably be the best for this - whilst quite in depth and potentially confusing if you're new, it's a great example of "best practice", demonstrates all features of PHP OOP and design patterns, and its online documentation is great.

 

I think there was a link in the App Design 'Resources' sticky, which covered exactly what you wanted - ie, getting under the bonnet of CodeIgniter - but it might have been removed. I can't find the link on Google either, so guessing that's why it's not listed any longer.

 

 

edit it wasn't codeigniter, it was CakePHP and the site they were originally on now seems to have moved.

 

http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-i:480f4dd6-28d0-445e-a1dc-4ceacbdd56cb

http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-ii:480f4dd6-57fc-4715-8709-439acbdd56cb

Share this post


Link to post
Share on other sites

I've just started using Zend Framework for a personal project, and what I really like about it is it's modularity. This means if I don't like how any part of the framework works, I don't have to use that part of it. In addition to that it means that it isn't too hard to use some of Zend's classes in other frameworks, or indeed without actually using a framework at all. It does look like it may be hard to do certain things though. Zend is MVC based which means I should easily be able to do certain things, for example: have an xml (for rss) or JSON (for ajax) view instead of an HTML one, and have the same controller be able to switch between different view types, say based upon some parameter given in the HTTP Request.

 

I have cast my eye over Symfony and it looks good, this may be the framework I start using in my day job (I don't get to make the decision about this).

 

One framework I have used professionally in projects I have inherited is CakePHP. I do not like this framework. The view and controller side of things seems ok, but how they handle the model is awful. I think there is a huge misconception within the PHP community that the model should be a type of object, rather than just a layer of your application. This is shown in Cake by the fact the model classes all extend the same model base class. This gives the impression of separate 'models', when the model should be a collection of classes that combined model the business logic of your application, and give it permanence (e.g. via the database). I would actually go so far as to have the model layer split into two separate sub layers: the persistence layer and the logic layer. The logic layer may be aware that the persistence layer exists, but does not care about the details of it.

 

Also the model in Cake and similar frameworks assumes I will be using a database to persist items from my model, and the model classes seem very tightly coupled to the idea that there is a one to one mapping between a database table and a model. I may, however, want to use a view which spans multiple tables and not a single table, not sure if Cake allows me to do this easily. Further still, what happens if part (or all) of my database doesn't use a database for persistence at all. These days with Google providing things like blogs via RSS / Atom and web services providing functionality like mailing lists, using a web service as a persistence layer instead of a database isn't so much of an edge case anymore, so frameworks need to be able to handle these things effortlessly. People may say that this is not what MVC is for, but the opposite is true. MVC is meant to allow me to easily switch between different types of Models, Views and Controllers. This is one of the main purposes of MVC.

 

Robin

Share this post


Link to post
Share on other sites

I have been using CakePHP almost exclusively for all my projects (professional and personal) over the past couple of years and cannot recommend it enough. I started using v1.2 in the early days and have now got completely used to the conventions used.

 

The documentation is getting much better, (see CakePHP Manual) and with 1.2 now being in RC2, more stable and mature.

 

rmbarnes82: CakePHP does in fact allow you to use resources other than database tables in the Model. If you are interested, have a look at CakePHP Models which explains CakePHP's implementation of the Model.

 

 

Share this post


Link to post
Share on other sites

I am in the process of writing rewriting an exist framework i built.  While the first version works and the speed of it seems pretty good, the model portion of the code seemed very bloated and not highly optimized and the over all structure of the model portion code was not very cleanly done.  The goal of the framework is to provide a very clean and small framework(like CodeIgnitor) but also has the power of model code generation(like symfony with propel).

 

As for the comment about Zend not supporting PHP 4, well since PHP has officially stopped development on PHP 4, I see no real reason to support it(and my framework does not).  I am still trying to decide if i want to make php 5.3 a requirement for my framework to make use of the late static binding which would allow for a little bit easier, smaller, and cleaner code in the ORM portion of my framework(and the main reason for late static binding is so there is only 1 class for each model unlike propel where there is a data model class and then a peer classes which seems like class for doing searches).  I may end up just having 2 classes per model in the ORM but not 100% sure yet.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.