FAQ

CakePHP v 2.x cheatsheet

Here are common CakePHP functions which are used to build software. Copy and paste these into your project to be efficient. 
-> All these codes are only a building block. 
-> Security is always completed after the initial system is created







# 1 > Find - model
function getByList($group_id)
{
$model = 'User';
$conditions = array(
array($model.'.group_id' => $group_id)
);

$found = $this->find('all', array(
'conditions' => $conditions,
'order' => $model.'.name asc',
//'contain' => array('UserType')
)
);
if (!empty($found)) {
return $found;
} else {
return false;
}
}