PHP

Scaffolding with CakePHP

What is scaffolding?

Its something that you will find very useful in production apps. When you begin, you may want to throw up stuff real quick in order to get started. Ultimately, its a built in system for adding, editing, viewing and deleting your database records quickly.

Database table

Suppose we want to work with a table named users, and here is its SQL structure

  1.  
  2. CREATE TABLE `users` (
  3.   `id` bigint(20) NOT NULL AUTO_INCREMENT,
  4.   `username` varchar(50) NOT NULL,
  5.   `name` varchar(50) NOT NULL,
  6.   `email` varchar(96) NOT NULL,
  7.   `password` varchar(50) NOT NULL,
  8.   `updated` int(11) NOT NULL,
  9.   `created` int(11) NOT NULL,
  10.  PRIMARY KEY (`id`),
  11.  UNIQUE KEY `username` (`username`)
  12. )

Now lets create a controller and a model file for cakephp.

read more...
Why choose CakePHP over other PHP frameworks

Those who have the slightest experience of Ruby on Rails would understand the importance of MVC (Model View Controller) framework for developing web applications. RoR is awesome, there is no doubt at all. But as a web developer, I have to build websites for others and this means I have to use their web host. Unfortunately, there are a very few web hosts supporting Ruby (compared to PHP).

When it comes to frameworks in PHP, you would immediately think of CakePHP, CodeIgniter, Symfony or Zend Framework. Now the question is which one serves the purpose best for you.

read more...
PHP Frameworks

Choosing a framework for PHP applications is not easy as it may seem. Different frameworks got different features (even to the slightest) and they may come handy. I will post another artcle on that later, but for now here is the list.

  • CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. (This site utilizes CakePHP framework)
    cakephp-framework
  • CodeIgniter is a powerful MVC framework. The official site is well documented and also has an active community of developers.
    codeigniter
  • ZendFramework (ZF) is more of a set of libraries than a MVC (model view controller) framework.
    zend-framework
  • Symfony is a full-stack framework, a library of cohesive classes written in PHP5.
    symfony-framework
read more...