Archives
- Newer posts
- November 2024
- April 2024
- November 2023
- October 2023
- August 2023
- May 2023
- February 2023
- October 2022
- August 2022
- July 2022
- May 2022
- April 2022
- March 2022
- February 2022
- June 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- August 2016
- June 2016
- April 2016
- March 2016
- February 2016
- January 2016
- July 2015
- June 2015
- Older posts
Baking a Cake and Programming?
In college, I had mostly done projects in Java. My internship project was also Java-based. Then I got a job as a PHP developer and I started working in core PHP. In Java, I knew a few frameworks but I had not used any framework in PHP, so I decided to learn Codeigniter in my free time. I went through a few tutorials and tried it out.
Later, when I joined OPSPL, I was asked to learn CakePHP. Both Codeigniter and CakePHP are MVC based frameworks. Since I was learning Codeigniter, it was easy for me to understand CakePHP too. CakePHP has a different directory structure from Codeigniter but the basic workflow is the same.
I started going through various tutorials, and I came across the first and very cool feature of CakePHP; code generation with bake commands. I just created a database table and by executing bake commands, I was able to create a full application structure. CakePHP automatically created the controller, model and view files with fully functional code to perform CRUD operations. Also, all the pages were styled using CSS and had a navigation menu on the left-hand side. All forms were validated using CakePHP’s validation. This kind of code generation is not possible in Codeigniter.
Templates and layouts help to implement the header and footer easily. These along with the main content of the page are stored individually. The layout combines them all and displays it to the users. This helps in projects where we want to show different layouts to different types of users.
CakePHP facilitates easy migration of database structure when moving a site from one location to another. The table structures are defined in migration files. Using these files, tables can be generated on the new server.
Another good thing that I like about CakePHP is that it has built-in functions to authenticate and authorize users. In Codeigniter, we have to write our own logic to authenticate users.
Both frameworks are powerful and help you develop web applications faster. Although they are similar in many ways, I found Codeigniter little easier to understand as compared to CakePHP. CakePHP is lightweight and provides better functionality. It is also the better choice for large applications.