SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 28
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zend Framework vs CakePHP

    Hey everyone,

    I've spent a couple of days researching php frameworks for a new app I am designing. I've narrowed my search down to zend and cake. Both offer all of the features I need. Anyone have any suggestions on how to decide between the two?

    I've never used a framework before, or done programming in the MVC style, so I'd like something easy to use. Cake seems to have better documentation atm, but I'm wondering if over the lifetime of the project Zend will overtake Cake because it seems to have a lot of momentum.

    Thanks,
    Kevin

  2. #2
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just create a simple application, or prototype with each of the frameworks and pick the one that suits your project best.
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    368
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i looked thru cakephp and to be honest it doesnt look as well and proffesionaly laid out as zend framwework

  4. #4
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mihd View Post
    i looked thru cakephp and to be honest it doesnt look as well and proffesionaly laid out as zend framwework
    They both serve their purpose but it depends on the projects which one is fits best.
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  5. #5
    SitePoint Zealot Rotwang's Avatar
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been trying to choose a framework (instead of using my own) for the past month. I haven't found one. (Mainly, I haven't found one that will wrangle namespaces for multiple controllers on the same page: http://www.sitepoint.com/forums/showthread.php?t=488302 )

    But here was my take on Cake (really Rails) and the Zend framework:

    Cake is based on Rails, and Rails is kind of like the Macintosh of frameworks. It's user-friendly, easy-peasy, but hiding details that you might care about. I also really don't like that it requires naming conventions for some of your database variables.

    The Zend framework is trying to be more "enterprise level" like J2EE, and it's more formal, which is a good thing. But you get the feeling that the guys designing it don't actually have to use it themselves. (Where, with CakePHP, the all actually do, or the main guys at least, one of them goes to my local PHP SIG, and he says "eat your own cooking" is one of their philosophies.)

    Hope that helps... Between the two I would probably go with Zend, but if you're mostly doing smaller apps then Cake may be better.

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you're just starting out, have you concidered codeigniter ? pretty easy to use

  7. #7
    PEACE WILL WIN abalfazl's Avatar
    Join Date
    Feb 2005
    Location
    Beyond the seas there is a town
    Posts
    711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello friends!

    If someone want to learn Zend framework,Which project do you suggest to choose in order to practice zend framework?

    Thanks...
    I shall build a boat,I shall cast it in the water,
    I shall sail away from this strange earth,
    Where no one awaken the heroes in the wood of love

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Hong Kong
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I love code ignitor. The downside is that it isn't GPL, which may cause some trouble depending on what you do with it.

  9. #9
    SitePoint Member
    Join Date
    Dec 2004
    Location
    New Philadelphia
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CakePHP for me. I have tried Symfony, CakePHP, CodeIgniter, and Zend (not the new 1 release, though). Out of those options, Cake was up and running in minutes, whereas the others took setup time and configuration. This is a RoR approach of convention over configuration.

    The overall structure of Cake is excellent, and you have the ability to extend/build at any level. For instance, I use HTML Strict versus XHTML Strict. With just a simple modification I was able to change their output tags from XHTML to HTML. Their helpers make things really easy to implement and extend.

    The database structure needs to be there. If you want a framework, you can't complain about the naming structure. It is there to help abstract pieces of the application. However, if you are picky or are dealing with legacy applications - you have complete power to over-ride the default naming conventions - even for keys with associations.

    The coding style is great and very easy to work with. There is a large community behind CakePHP. Their API is extremely easy to use so you are never left wondering.

    BUT - it is up to you and your project. Try a few out. A big indicator to me was getting something up and running. If it was a hassle or I had to instantly spend hours in an API to figure out how to get a simple application working - then I didn't want to spend my entire time working with something like that.

  10. #10
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nateklaiber View Post
    A big indicator to me was getting something up and running.
    Especially the first time that can be rather annoying, that why I create simple bash scripts to do that for me. Example; this scripts sets up a directory structure for the Zend Framework and installs the framework inside of it.

    bamboo.sh
    Code:
    #! /bin/bash
    APPLICATION=""
    
    while [ "$1" ] ; do
            case "$1" in
                    -a)
                            if [ "$#" -lt 2 ] ; then
                                    echo "To few arguments!"
                                    exit
                            fi
                            APPLICATION="$2"
                            mkdir trunk
                            mkdir tags
                            mkdir branches
                            cd trunk
                            mkdir www
                            mkdir tests
                            mkdir build
                            cd www
                            mkdir $2
                            mkdir "$2/etc"
                            mkdir "$2/lib"
                            mkdir "$2/usr"
                            mkdir "$2/usr/default"
                            mkdir "$2/usr/default/controllers"
                            mkdir "$2/usr/default/models"
                            mkdir "$2/usr/default/views"
                            mkdir "$2/usr/default/local"
                            mkdir "$2/var"
                            mkdir "$2/var/sessions"
                            mkdir "$2/var/cache"
                            mkdir "$2/var/view_compiles"
                            mkdir "$2/var/log"
                            echo "Deny From All" > "$2/.htaccess"
                            echo "<?php
    set_include_path(\".\" . PATH_SEPARATOR . realpath(\"./$2/lib\"));
    include \"Zend.php\"
    include \"Zend/Loader.php\"
    
    Zend_Loader::loadClass(\"Zend_Controller_Front\");
    Zend_Loader::loadClass(\"Zend_Controller_Router_Rewrite\");
    
    \$router = new Zend_Controller_Router_Rewrite();
    \$controller = Zend_Controller_Front::getInstance();
    \$controller->setControllerDirectory(\"./$2/usr/default/controllers\");
    \$controller->setRouter(\$router)->setBaseUrl(\"/www/\");
    \$controller->throwExceptions(true);
    \$controller->returnResponse(false);
    \$controller->dispatch();" > "index.php"
                            echo "RewriteEngine on
    RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
    
    php_flag display_errors on
    php_flag register_globals off
    php_flag html_errors on
    php_flag magic_quotes_gpc off
    php_flag short_open_tag off
    php_value error_reporting \"E_ALL | E_STRICT\"
    # although hardly used:
    php_flag magic_quotes_runtime off
    php_flag magic_quotes_sybase off" > ".htaccess"
                            echo "<?php
    require_once \"Zend/Controller/Action.php\"
    class IndexController extends Zend_Controller_Action
    {
            public function indexAction()
            {
                    echo \"Hello world!\";
            }
    }" > "$2/usr/default/controllers/IndexController.php"
                            mkdir "images"
                            mkdir "scripts"
                            mkdir "styles"
                            echo "Downloading Zend Framework:"
                            curl -o /tmp/Zend.tar.gz -LS\# http://framework.zend.com/releases/ZendFramework-1.0.0/ZendFramework-1.0.0.tar.gz
                            echo "Installing Zend Framework:"
                            mkdir /tmp/Zend
                            tar xzvf /tmp/Zend.tar.gz -C /tmp/Zend
                            ZEND_DIR=`ls /tmp/Zend`
                            echo "DIR"
                            echo $ZEND_DIR
                            mv "/tmp/Zend/$ZEND_DIR/" "$2/lib/Zend"
                            rm -rf /tmp/Zend /tmp/Zend.tar.gz
                            shift
                            ;;
                    -m)
                            if [ "$APPLICATION" = "" ] && [ "$#" -lt 3 ]
                            then
                                    echo "No application specified"
                                    exit
                            else
                                    cd trunk
                    #               echo "$APPLICATION"
                                    if [ "x$APPLICATION" = "x" ] ; then
                                            cd www
                                    fi
                                    if [ "x$APPLICATION" = "x" ] && [ "x$3" != "x" ] ; then
                                            APPLICATION=$3
                                    fi
                    #               echo "$1 $2 $3"
                                    mkdir "$APPLICATION/usr/$2"
                                    mkdir "$APPLICATION/usr/$2/models"
                                    mkdir "$APPLICATION/usr/$2/views"
                                    mkdir "$APPLICATION/usr/$2/controllers"
                                    mkdir "$APPLICATION/usr/$2/local"
                                    shift
                                    if [ "x$3" != "x" ] ; then
                                            exit
                                    fi
                            fi
                            ;;
                    *)
                            echo "Invalid argument $1"
                            ;;
            esac
            shift
    done
    APPLICATION="" # reset application so it won't be set te next run
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  11. #11
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to work faster go with CakePHP
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  12. #12
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'd recommend you to choose CakePHP. It's a powerful MVC framework, with a growing user base. There're some drawbacks though: one of them is the lack of documentation.

    BUT - it is up to you and your project. Try a few out. A big indicator to me was getting something up and running.
    I totally agree with nate here.

  13. #13
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's simple:

    Cake download = 206 KB
    Zend download = 3.1 MB

    conclusion: Cake is better.

  14. #14
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Conclusion: Cake was built by a single developer who couldn't write as much code as all the people working on ZF.

  15. #15
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Correct. The question is, do we actually need that much code.

  16. #16
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    More's better right? In fact, you can use Symfony (which weighs in at a bit under 2MB), and run the entire Zend Framework as a plugin to a Symfony project.

    http://trac.symfony-project.com/trac/wiki/sfZendPlugin

    A bridge between the frameworks with autoloading of Zend classes you use in your Symfony project

  17. #17
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    More's better right? In fact, you can use Symfony (which weighs in at a bit under 2MB), and run the entire Zend Framework as a plugin to a Symfony project.

    http://trac.symfony-project.com/trac/wiki/sfZendPlugin

    A bridge between the frameworks with autoloading of Zend classes you use in your Symfony project
    Why? do you really want to load 2 frameworks
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  18. #18
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Since only classes you use get loaded at runtime, you get to pick and choose what parts of both frameworks to use in your project, without any significant drawbacks other than self-imposed complexity

  19. #19
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If what you can't get from one framework, your not going to get it from two frameworks; It's not an indictment against any given framework though, it just means that the framework isn't suitable for your needs.

    You have the choice of course to pick and choose, but to merge?

  20. #20
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ive only ever used Zend Framework, and have liked it so far. Some points I like about it:
    - started and supported by Zend itself, so I am confident support will continue to grow for it
    - it is a "glue" framework. I can pick and choose what to use, without being locked into using the entire framework

    One downside I have found, is that the framework has a bit of overhead to it, in terms of page load times (though how this compares to other frameworks, I don't know). Not bad enough to warrant not using it, but if all you really want out of a framework is the MVC, then you'd probably just be better off rolling your own.

  21. #21
    SitePoint Member scorps's Avatar
    Join Date
    Jul 2004
    Location
    Estonia
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use Qcodo over Zend. Zend dont have decent ORM nor ajax driven stateful forms.

  22. #22
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mr_Money View Post
    - it is a "glue" framework. I can pick and choose what to use, without being locked into using the entire framework
    Good point.

    Where Cake is first and foremost an infrastructure, with components attached to it, ZF is more of a component library, but with some components, that gives infrastructure. The difference is, that you can pick ZF components out of the framework and use them.

    I've used some of the components from Zend Framework (Specifically Search_Lucene and Mail) and as a component library I like it. I don't have any need for the infrastructure parts though.

    In this perspective, I can see how the sfZendPlugin can be useful. Symfony, like Cake, has a lot of infrastructure, and fewer components. It could benefit from pulling in standalone components from ZF. It's just like how you might want to pull in a PEAR class, or a class from ezComponents (Which I'm also using now and then).

  23. #23
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken View Post
    In this perspective, I can see how the sfZendPlugin can be useful. Symfony, like Cake, has a lot of infrastructure, and fewer components. It could benefit from pulling in standalone components from ZF. It's just like how you might want to pull in a PEAR class, or a class from ezComponents (Which I'm also using now and then).
    OFFTOPIC:

    it seems you have used Zend framework before (I was looking for someone who did).

    and it also seems that you have also used Symfony.

    Which facts would make you to use one in place of other? I am looking into Symfony, but like you mentioned, I don't want to use something which i can't use in parts.

    ANd to clear, i have just installed Symfony and hasn't started using it. i was planning to start this weekend. As time is of importance and i don't want to test frameworks (just for the sake of testing, will do that when i am done with thi sproject) i wanted to start with a framework which is more effective.

    thanks
    ---------------------------
    Errors = Improved Programming.
    My Site

  24. #24
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jaswinder_rana View Post
    Which facts would make you to use one in place of other? I am looking into Symfony, but like you mentioned, I don't want to use something which i can't use in parts.
    As I said, I think they are quite different in their approach to the framework concept. I have no use for an infrastructure, but I can certainly use good components. Symfony is mostly about infrastructure, while ZF tries to do both.

    I couldn't recommend either, since it really depends on your requirements. If you need a good infrastructure, it may be better to go with something, which is tightly integrated, such as Symfony or Cake.

  25. #25
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my case, I need a complete framework with everything (basic at least my add more later on) like DB, mailer, AJAx etc.

    So, as i need all this working in my project (not jsut one aspect) so i am assuming i should go with infrastructure (Symfony in my case) one, right?

    thanks
    ---------------------------
    Errors = Improved Programming.
    My Site


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •