Re: Error with pagination using condition
On Wed, Aug 18, 2010 at 8:34 PM, Daniel Rodriguez <dornad@gmail.com> wrote:
> Hello all,
>
> Here is my problem. I'm getting the following error:
>
> Parse error: syntax error, unexpected '(', expecting ')' in C:\Users
> \dann\xampplite\htdocs\myApp\app\controllers
> \applications_controller.php on line 10
>
> Here is the code:
>
> [START_CODE]
>
> var $searchCondition = array(
> (10) 'Item.date >' => date('Y-m-d', strtotime("-2 weeks"))
> );
>
> var $paginate = array(
> 'conditions' => $searchCondition,
> 'limit' => 25,
> );
>
> function index() {
> $this->set('applications',$this->paginate());
> }
>
I don't see where the unbalanced brace is but you shouldn't be able to
define class vars like that, anyway. Try:
var $paginate = array(
'conditions' => array(
'Item.date >' => date('Y-m-d', strtotime("-2 weeks"))
),
'limit' => 25,
);
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home