Code Ignite or Cake PHP?

Discussion in 'PHP' started by pwaring, Jul 7, 2007.

  1. #1
    I've been having a look around at PHP frameworks in the last week or so because I'm a bit fed up of reinventing the wheel each time I launch a new site. So far I've come across Code Ignite and Cake PHP and I was wondering if anyone had any recommendations for/against either framework? Has anyone used them on their own sites?
     
    pwaring, Jul 7, 2007 IP
  2. InFloW

    InFloW Peon

    Messages:
    1,488
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There is also Zend Framework which you may want to consider as well. As for using them not a big fan of them at this point. Over time I've built my own framework for what I do so I don't exactly need all the features these have.
     
    InFloW, Jul 7, 2007 IP
  3. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #3
    I hadn't heard of Zend Framework, I thought everything Zend produced required purchasing. I like some of the things I see there, especially the registry idea.
     
    pwaring, Jul 7, 2007 IP
  4. CodyRo

    CodyRo Peon

    Messages:
    365
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It depends on what you're goals are / needs. I personally have been playing with CodeIgniter / Zend Framework.

    CodeIgniter is a decent light-weight alternative to Zend's, its approach to MVC is a bit more lax / mellow as well. Zend is far more robust and has a lot more built in things, it would also be considered a bit more "advanced" in comparison with CodeIgniter.

    What are your goals / needs and maybe we can be of more help :)
     
    CodyRo, Jul 7, 2007 IP
  5. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    My personal choice is CodeIgnitor. I have made a couple of apps using it and I liked it very much. CakePHP has some features like Database association to Model classes, but since I like more control over what is being done, I like Codeignitor more. Many things are done by itself in Cake, and I don't like the idea of not knowing whats going on. It may make things difficult if things start acting up.

    CodeIgnitor seems to be best combination for me. Just the right amount of things it does for us and leaves the rest to us.

    ~
    Thomas
     
    coderlinks, Jul 8, 2007 IP
  6. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #6
    Well basically I tend to create a lot of sites which have a common header/footer (the header needs information passing to it such as the title of the page and perhaps some dynamic information pulled from session data and/or the database) and perhaps 10-15 templates which are populated by the database. E.g. Game Demos - I wrote that site by hand but it took quite a bit of time as there were lots of repetitive tasks such as setting up the DB connection each time etc. I also had to create mod_rewrite rules for every separate PHP script (e.g. browse/{$X}/ -> browse.php?letter={$X}), which I'd rather not do.

    Code Igniter seems ok but it seems to treat a view as an entire page. The user guide suggests that a view can be a header/footer as well but I can't find a decent example of someone doing this.
     
    pwaring, Jul 8, 2007 IP
  7. InFloW

    InFloW Peon

    Messages:
    1,488
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #7
    A framework in this case honestly sounds like something that you may not want to get into if you're not currently even using a single point of entry on applications. You have things like browse.php, games.php ect. If you create a single entry point for all you will only need to do a lot of the common declarations in just one file. A framework does this because they force you to but a framework is not a requirement in order to do it.


    So here's a little code example for what they are in fact doing


    
    // Index.php
    <?php
    include('config.php');
    $db = new Database();
    $db->connect($myinfo);
    $tpl = new Template();
    
    $tpl->display('header.tpl');
    
    switch ($_REQUEST['s'])
    {
    case 'games':
    include('games.php');
    break;
    
    case 'browse':
    include('browse.php');
    break;
    }
    
    $tpl->display('footer.tpl');
    
    ?>
    
    PHP:
    Now this example forces you to declare all the pages but this should give you an idea on how to approach this a bit better.
     
    InFloW, Jul 8, 2007 IP
  8. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #8
    I'm not sure that I agree about the single point of entry being the best approach - I prefer to have things separated out into different files if possible so that I'm not mixing things up, plus I don't really like the way Code Igniter handles views as you can't load multiple views (e.g. header/footer/content) without passing an extra parameter and using echo or creating another view and passing the contents of the others to it. I've managed to avoid duplicating all that code by using two custom libraries, but at the moment I seem to be writing the same amount of code as I was when I created my own scripts from scratch and used Smarty to process the templates. I'll see how it goes though.

    Thanks for the explanation though. :)
     
    pwaring, Jul 8, 2007 IP
  9. codecreator2010

    codecreator2010 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I work now in Codelobster PHP Edition.
    It's very comfortable and free PHP, HTML, CSS, JavaScript editor.
    The last version become Portable, that allows to install it on the flash drive
    and use it on any computer
    Want to mark the presence of PHP debugger, that make this editor valuable PHP IDE.

    +it have special plugins for autocomplete and context help for
    Drupal, Joomla, JQuery, Smarty, WordPress, Facebook, CakePHP and CodeIgniter.
    http://www.codelobster.com
     
    codecreator2010, Jan 27, 2011 IP