OK so I'm facing two big project redesigns. Moving from old, nasty code to a brilliant redesign under some new framework. I've been fairly impressed with CodeIgniter lately mostly because of its clever request routing structure and it's light weight. Certain things (e.g., hyphenated urls, autoload functions, etc.) have presented challenges.

And someone recommended Laravel which seems to me to require the learning of yet another PHP framework dialect, possibly also a templating language (blade) . It also has a number of prerequisites (composer, artisan) and seems mostly targetted toward site and code deployment. I cannot yet tell to what degree it might aid code clarity, organization, and maintainability. It's very popular on google trends lately but not so much in the various job postings and project descriptions.

Does anyone have thoughts on favorite PHP frameworks? Is CakePHP dead? Is Symfony dead? Is CodeIgniter dying? Is Laravel really the next big thing?

    Check out some of the free tutorials at Laracasts.com, and see if they tweak your interest in Laravel or not. I like it so far, and the Artisan tool can be really useful (mostly used it to create database migrations so far). It's quite a bit like Rails, but not exactly, leveraging things PHP does that Ruby does not, and such. I think that for now, Laravel is the clear leader -- but 2015 hasn't even started yet. 🙂

      Thanks for your response.

      From what I've seen so far, Laravel's features ALL seem targetted at site deployment and update deployment -- a very useful feature for big web dev shops that are rolling out all kinds of sites all the time but possibly an impediment for the types of work I've had lately. I've been working on a handful of sites that have outgrown some original constrictive framework and which are headed to toward load-balanced or clustered configurations and one of which has a multi-threaded app that manages an asset pipeline. Laravel sounds like a dream for someone who is not especially familiar with the commands to install various components or copy files, but I worry that it might be too clever for its own good. I find the use of closures for routing pretty puzzling. Why do this? I also am generally opposed to frameworks that involve some impenetrable thicket of class nestings and function routing (cough cough Joomla cough cough) just to route a single page request. Beyond the quick CLI commands to deploy a new site (I will do this maybe three times in 2015) and update a project from GitHub (a feature of Laravel Forge -- do I pay for this), I wonder how Laravel is useful when deploying a new feature such as a new form with input validation and some resulting database operations. Does it help in this case? Or must I simply learn a new dialect of PHP?

      NogDog;11044217 wrote:

      Check out some of the free tutorials at Laracasts.com, and see if they tweak your interest in Laravel or not. I like it so far, and the Artisan tool can be really useful (mostly used it to create database migrations so far). It's quite a bit like Rails, but not exactly, leveraging things PHP does that Ruby does not, and such. I think that for now, Laravel is the clear leader -- but 2015 hasn't even started yet. 🙂

      I've seen the first two or so, will watch more. So far the rapid deployment features are interesting but also seem bound to Composer, Artisan, Github, and possiby 'forge' which looks like some kind of monetization attempt by the Laravel developers. I've not seen enough yet to know about the non-deployment-related advantages it might offer.

      You say "it's quite a bit like Rails, but not exactly." Can you be more specific?

        Regarding CodeIgniter, I have found some criticism here. In particular, he says:

        I don't really like CodeIgniter because it's too dumbed down. It focuses on trivial stuff (Javascript class?) and ignores some essential things (site-wide layouts?). It also fails to use namespaces, which to me is completely unacceptable at the precipice of PHP 5.5.

        He levels some pretty good criticism:

        CodeIgniter supports extending the core classes, but it does so in a very unnatural and weird way. To extend the Core classes, you would need to define a prefix (default is MY_) and prefix all new classes with it. They would also all have to be in the same folder as the Core classes. This makes upgrading CI very awkward, and the classes look downright silly having to have a prefix

        .
        Bruno proposes listing his own classes in the classmap file. I found it easier to register an autoloader function in a config file (which might be a bit unorthodox). No idea how performance might be affected by this.

        CodeIgniter's Controller class is so light it's almost useless, it's like it's there just to satisfy the naming convention of MVC. It's no more than a wrapper for view functionality in its default state, which to me was completely counter-intuitive. I wanted to have some "Zendish" methods there, like checking the type of request, fetching params and providing default values if they're not present, doing some ctype checks etc.

        Not sure I agree with Bruno here. I like a light framework -- although having to check if the request is POST or GET is kind of annoying and this issue seems solved in Laravel with the routing scheme. If you define a ::post routing, you needn't check to see if METHOD=POST.

        CI has no layouting of any kind. By layouting, I don't mean making it look good, I mean actual structural scaffolding - if I want a set of views to have a specific layout (header - body - footer) and another set of views to have another layout (header - side bar + body + side bar + footer), I'd like to be able to have this defined in a single file and reflected on all others. I don't want to have to edit my every view if I want to add a new script tag, nor do I want to have to change every view's HTML just to make a site-wide change.

        I know CI supports the $this->load->view call from the controller, and this lets you call view files so that you can basically treat them as building blocks but I don't like this implementation. It doesn't seem "templatey" enough and feels hacky.

        .
        I'm not sure how to respond to this. I've always created distinct views for page sections rather than expecting to create one massive view for my entire site. I'm not sure what he means.

          I used to love CodeIgniter when I was getting into frameworks. I found it was easy to use and quick to get a site going with it. However, for about 2 years now I've been rolling my own framework, which has aided me tremensely. Its super lightweight, and I can get most sites up in a couple days once design is complete thanks to having already written the common modules (blog, user management, layout management, etc).

          As for templating, I haven't built templates for individual pages in a long time. I've moved to all SPAs (single page applications) which means the default view is the only view now, and the rest is loaded via API calls.

          I know I absolutely hated ZF2, Cake and Symphony. I haven't messed with Laravel but I have heard very good things from those who have. Given that, I would probably go with CI or Laravel, if speed to up time is most key, I would go with CI as you seem to be familiar with it already.

            Derokorian;11044243 wrote:

            I used to love CodeIgniter when I was getting into frameworks. I found it was easy to use and quick to get a site going with it. However, for about 2 years now I've been rolling my own framework, which has aided me tremensely. Its super lightweight, and I can get most sites up in a couple days once design is complete thanks to having already written the common modules (blog, user management, layout management, etc).

            That sounds like a good customer loyalty mechanism! It also sounds like a good way to avoid the shortcomings of existing frameworks. Having seen Laravel and spoken to another hot-shot developer I know, I believe that things are moving toward immediate deployment. I.e., concocting not just a framework but deployment tools to get it up and running in minutes rather than days. Since a lot of the work I've been paid for this year seems to be server config and troubleshooting, I find this mildly alarming. I'd love to have some scripts to auto-deploy my framework to a new machine, but I wonder if the scripts I might concoct would be flexible enough to address all the circumstances I've encountered in the past. I'm also getting pretty tired of the vast proliferation of tools and frameworks that each have their own learning curve. I am trying to resign myself to always learning, but...sigh...it's pretty dry subject matter.

            Derokorian;11044243 wrote:

            As for templating, I haven't built templates for individual pages in a long time. I've moved to all SPAs (single page applications) which means the default view is the only view now, and the rest is loaded via API calls.

            Care to share any detail? I'm supposed to be looking into Angular.js for one project I'm on. I'm pretty curious about SPAs but am skeptical of the heavy JS that is likely required. I also wonder how to organize volumes upon volumes of JS code.

            Derokorian;11044243 wrote:

            I know I absolutely hated ZF2, Cake and Symphony. I haven't messed with Laravel but I have heard very good things from those who have. Given that, I would probably go with CI or Laravel, if speed to up time is most key, I would go with CI as you seem to be familiar with it already.

            Laravel is based on symphony apparently:

            aravel is built on top of several Symfony components, giving your application a great foundation of well-tested and reliable code.

            Care to air any more specific grievances? I'd certainly like to hear them and it might make you feel better too.

              I can't claim to be be a Rails expert, nor really even a Laravel expert, either (yet). It just sort of "felt" similar to me to this point during my scratchings at the surface of each -- but then they're both, at core, just another MVC framework*. I think it's the command line tools that each uses to help streamline the creation and maintenance process that felt similar to me. (I have, however, not warmed up to the Ruby language at all, and so for now do not expect to become a Ruby/Rails power user unless unexpected -- but far from impossible -- things happen here at work.)

              Laravel's "Eloquent" ORM looks pretty nice, and perhaps a little easier for me to learn/use than CI's Active Record stuff was; but then that could just be the difference in a few years of growing as a PHP and SQL coder since I last looked at that aspect of CI. 🙂


              • I spend the bulk of my coding time these days using an in-house PHP framework modeled after Java Struts
                sneakyimp;11044251 wrote:

                That sounds like a good customer loyalty mechanism! It also sounds like a good way to avoid the shortcomings of existing frameworks. Having seen Laravel and spoken to another hot-shot developer I know, I believe that things are moving toward immediate deployment. I.e., concocting not just a framework but deployment tools to get it up and running in minutes rather than days. Since a lot of the work I've been paid for this year seems to be server config and troubleshooting, I find this mildly alarming. I'd love to have some scripts to auto-deploy my framework to a new machine, but I wonder if the scripts I might concoct would be flexible enough to address all the circumstances I've encountered in the past. I'm also getting pretty tired of the vast proliferation of tools and frameworks that each have their own learning curve. I am trying to resign myself to always learning, but...sigh...it's pretty dry subject matter.

                I have a script in my framework to deploy, it just requires config for the server be set up. The config is stored in the customer's repository, and the script pushes based on git hashes, so I can also push any commit to the server. This allows for easy roll-back as well if I mess something up (not that I would ever do that!). I also have written my framework in such a way that I can ssh into the server and update the db from structure defined in the project (namely, I do cli.php upgrade or cli.php install). I would say most of my project time is spent adjusting the angular models and changing views to match design, and very little on server config. I run a custom rpm to install all the necessary programs; such as php, mysql, apache and their dependencies, though not in that order.

                sneakyimp;11044251 wrote:

                Care to share any detail? I'm supposed to be looking into Angular.js for one project I'm on. I'm pretty curious about SPAs but am skeptical of the heavy JS that is likely required. I also wonder how to organize volumes upon volumes of JS code.

                As I've eluded to earlier, I use angularjs for developing client side now. In addition, I use requirejs for managing dependencies and keeping files specific to their function. An example of my folder structure:

                + root
                | - app.js
                | - home.html
                | + user
                  | - controller.js
                  | - model.js
                  | - login.html
                  | - logged-in.html
                | + blog
                  | - controller.js
                  | - model.js
                  | - directives.js
                  | - view-post.html
                  | - view-comment.html
                  | - add-post.html
                  | - add-comment.html
                
                sneakyimp;11044251 wrote:

                Care to air any more specific grievances? I'd certainly like to hear them and it might make you feel better too.

                They just seemed so heavy and I feel like my sites perform better not using them. True, I could get something going - but debugging and looking at the call stack was a bit ridiculous. I also realize now, that I tried most of the FW I've worked with years ago, so things may be different.

                  15 days later

                  I went so far as to buy a book on Rails and decided--admittedly far too early--that I didn't like the look of it. Determining code blocks and scope via ident seems like a bad idea to me. I've never managed to understand what advantage it ostensibly brings. I've never seen it expressed in some meaningfuly way. People always say things like "they're teaching it at universities" or "all the startups demand it." Enthusiasm (as charted by Google Trends anyway) seems to have peaked around 2007 and declined since. That said, it's far more popular than either CodeIgniter or Laravel. Laravel seems to be spanking CodeIgniter's popularity too. I have no idea why. I justify my suspicion of these new languages by telling myself they have features for coders who need things simplified and who don't know (and don't want to know) about how things really work and how to configure their web servers. My inner curmudgeon fears the possibility that they do actually result in faster ("more agile"...gag) development. In reality, I don't know the difference and hate the idea of spending lots of time learning all these different languages and frameworks enough to decide for myself.

                  Derokorian;11044267 wrote:

                  I have a script in my framework to deploy, it just requires config for the server be set up. The config is stored in the customer's repository, and the script pushes based on git hashes, so I can also push any commit to the server. This allows for easy roll-back as well if I mess something up (not that I would ever do that!). I also have written my framework in such a way that I can ssh into the server and update the db from structure defined in the project (namely, I do cli.php upgrade or cli.php install). I would say most of my project time is spent adjusting the angular models and changing views to match design, and very little on server config. I run a custom rpm to install all the necessary programs; such as php, mysql, apache and their dependencies, though not in that order.

                  I really like the idea of this homespun configuration tool, but I think most of my respect derives from the fact that you built it yourself. I've started to move toward configuration tools and such. In particular, I created a 'template server' -- an Amazon EC2 instance that has a LAMP stack and a lot of mail- and security-related configurations. Starting a new website usually just involves building a new server from an Amazon AMI. I still have to configure database credentials, a domain, email, etc. by directly editing config files. I'm still trying to sort how I can set up a website to easily support production, development, and individual workstation configurations while storing code in a single git repo without people being privy to others' credentials and without having to create some elaborate .gitignore file.

                  In practice, I do not build a lot of new websites. I tend rather to maintain a few websites with large number of users and/or extraordinary functional requirements (like an asset pipeline that processes millions of images per day). The serving of web pages is the primary consideration, but the integration of unusual processes or meeting unusual performance requirements is what makes them unsuitable for an out-of-the-box configuration model -- at least in my opinion.

                  Derokorian;11044267 wrote:

                  As I've eluded to earlier, I use angularjs for developing client side now. In addition, I use requirejs for managing dependencies and keeping files specific to their function. An example of my folder structure:

                  + root
                  | - app.js
                  | - home.html
                  | + user
                    | - controller.js
                    | - model.js
                    | - login.html
                    | - logged-in.html
                  | + blog
                    | - controller.js
                    | - model.js
                    | - directives.js
                    | - view-post.html
                    | - view-comment.html
                    | - add-post.html
                    | - add-comment.html
                  

                  I need to ramp up my AngularJS understanding immediately. Any materials to steer me toward the AngularJS awakening would be much appreciated. My first question is what is so @!@#$ great about AngularJS?. I.e., why use it? Does it mean I have structure my site as a Single-Page Application (SPA) ?

                  Also, managing dependencies in JS seems like a total nightmare. A series of include/require statements in PHP is nightmare enough and can be solved with some kind of autoloader, but in JS you are potentially dealing with sequencing subsequent asynchronous http requests. I shudder at the thought.

                  Derokorian;11044267 wrote:

                  They just seemed so heavy and I feel like my sites perform better not using them. True, I could get something going - but debugging and looking at the call stack was a bit ridiculous. I also realize now, that I tried most of the FW I've worked with years ago, so things may be different.

                  Some frameworks definitely seem sluggish. All the hooks and routing features and application of regex pattern matching for urls and checking the file system for corresponding files and various other actions that are repeated every time seem so over-the-top sometimes. CodeIgniter seems pretty light to me and understanding it's url-to-controller routing scheme is pretty intuitive, but I wonder sometimes about its performance and security compared to other schemes. That said, I do like the way it facilitates sane code organization and rapid development. The compilation of code into some kind of DLL or JAR file seems positively medieval.

                    sneakyimp;11044439 wrote:

                    I really like the idea of this homespun configuration tool, but I think most of my respect derives from the fact that you built it yourself. I've started to move toward configuration tools and such. In particular, I created a 'template server' -- an Amazon EC2 instance that has a LAMP stack and a lot of mail- and security-related configurations. Starting a new website usually just involves building a new server from an Amazon AMI. I still have to configure database credentials, a domain, email, etc. by directly editing config files. I'm still trying to sort how I can set up a website to easily support production, development, and individual workstation configurations while storing code in a single git repo without people being privy to others' credentials and without having to create some elaborate .gitignore file.

                    Well the configuration file I use is pretty simple actually, I'm sure you can follow it just fine. You can see it here https://github.com/derokorian/DeroFramework/blob/master/dero/core/Config.php but basically there are defaults that my framework "ships" with, and a folder where anything can be added or overwritten that's not included in projects by .gitignore which also means this folder is no overwritten by doing a git pull or checkout.

                    *Note: I haven't kept the github up-to-date with the framework changes in my last 5 or 6 projects, but if you look around you might see some useful things, and since I put it there go ahead and use it!

                    sneakyimp;11044439 wrote:

                    I need to ramp up my AngularJS understanding immediately. Any materials to steer me toward the AngularJS awakening would be much appreciated. My first question is what is so @!@#$ great about AngularJS?. I.e., why use it? Does it mean I have structure my site as a Single-Page Application (SPA) ?

                    I recommend http://egghead.io for learning anything you need to know about angular.

                    sneakyimp;11044439 wrote:

                    Also, managing dependencies in JS seems like a total nightmare. A series of include/require statements in PHP is nightmare enough and can be solved with some kind of autoloader, but in JS you are potentially dealing with sequencing subsequent asynchronous http requests. I shudder at the thought.

                    I think I mentioned it before, but use RequireJS for managing dependancies in javascript, not just angular. Think of it as a "require_once" with automatic hierachy and dependancy resolution.

                      10 days later

                      Derokorian, just wanted to thank you for your last post. Been juggling a few things (and fighting influenza) but still hoping to digest your suggestions.

                        4 years later
                        Write a Reply...