Category Covered

Cakephp find conditions  

Name   Default Description type   'first' can be 'all', 'first', or 'list'. determines what type of find operation to perform. conditions   array containing the find (select) conditions as key/value pairs fields  
By: Tech writer  |   Total Read: 2336  |   Read more..

CakePHP Controller properties methods callbacks  

CakePHP controller properties:
$name = null
$action = null
$autoLayout = true
$autoRender = true
$base = null
$beforeFilter = null
$cacheAction = false
$components = array()
$data = array()
$helpers = array('Html')
$here = null
$layout = 'default'
$output = null
$pageTitle = false
$params = array()
$persistModel = false
By: Tech writer  |   Total Read: 808  |   Read more..

CakePHP recursive tutorial  

Cakephp recursion tutorial -1 Cake fetches Group data only, no joins. 0 Cake fetches Group data and its domain 1 Cake fetches a Group, its domain and its associated Users 2 Cake fetches a Group, its domain, its associated Users, and the Users’ associated Articles Example $this->Model->recursive = -1;   Next Step: Cakep  
By: Tech writer  |   Total Read: 1063  |   Read more..

CakePHP association models  

CakePHP association or relationship between models   Relationship    Association Type       Example one to one      hasOne                 A user has one profile. one to many     hasMany              &  
By: Tech writer  |   Total Read: 1129  |   Read more..

CakePHP Naming Conventions  

If you want good support from cakephp library you must follow the cakephp naming convention.

Database, table & field name convention:

1. Create your database.
2. Table name convention - lowercase, plural, multi-word tables to be separated by underscore.
    Example:  users or doctor_patients etc
2. Each table must have one PRIMARY KEY to be named as 'id' (NOT NULL Auto Inc  
By: Tech writer  |   Total Read: 865  |   Read more..

CakePHP tutorial  

Here i am going to write a step by step beginners cakephp tutorial This tutorial is based on cake version 2.x CakePHP Directory Structure /app //This is the folder where you only work no where else /Config /Schema db_acl.php db_acl.sql i18n.php i18n.sql sessions.php sessions.sql acl.ini.php acl.php bootstrap.php //Always e  
By: Tech writer  |   Total Read: 1088  |   Read more..

How to set limit on cakephp find  

If you want to set cakephp limit on your cakephp find query follow the example   $results = $this->User->find('all', array( 'conditions' => array('OR'=> array('User.first_name LIKE' => '%' . $query . '%'), 'fields' => array('', 'User.first_name'), "limit" => 20 )); K5F3YMRV6YNH  
By: Tech writer  |   Total Read: 1501  |   Read more..

How to write or condition on cakephp query  

If you want to add a OR condition on cakephp condtions you can follow this statement.  Here is the complete query example   'Company' => array ( 'conditions' => array ( 'OR' => array( 'Company.status' => 0, 'Company.status' => $status, ) ) )  Here is complex query example on cakephp or condition $results = $this->User->find('list', array(  
By: Tech writer  |   Total Read: 1044  |   Read more..

Cakephp form saving problem  

Sometimes we see that everything is fine and no error are showing when we are going to save a cakephp form but cakephp form is not saving on that cases you can test is there any validation error is there or not by using on following code after the save action.    debug($this->Customer->validationErrors);  
By: Tech writer  |   Total Read: 625  |   Read more..

CakePHP CSS Image not loading  

If you see that when you are going to deploy a cakephp project that css and image are not loading on your application then you have to think about few things. Here are issue that you need to take care 1. Make sure that your server Apache mod_rewrite is enabled. If you are using third party webhosting then just tell them to enable "mod_rewrite" 2. The .htaccess parallel to your app folder make sure that you the following contents Pat  
By: Tech writer  |   Total Read: 2697  |   Read more..
Top 15 Posts