I have the following code in a CakePHP Controller:
var $searchCondition = array(
'Item.date >' => date('Y-m-d', strtotime("-2 weeks")) // line 11
);
var $paginate = array(
'conditions' => $itemCondition,
'limit' => 25,
);
function index() {
$this->set('applications',$this->paginate());
}
I am getting the following error:
Parse error: syntax error, unexpected '(', expecting ')' in D:\xampplite\htdocs\myApp\app\controllers\applications_controller.php on line 11
Does anyone knows what it means? I’ve double checked and the syntax seems to be right.
Thanks
You can only use constant values when initializing class properties. You cannot use functions here. You’ll have to do something like this: