0
$this->paginate = array(
     'limit' => 5,
     'conditions' => ''
);


$this->paginate['conditions'] = array(
     'name LIKE' => '%a'
);

and them notice:

Notice (8): Indirect modification of overloaded property EmployeeCvsController::$paginate has no effect [APP\Controller\EmployeeCvsController.php, line 137]

Could someone explain me why I can't change order element from array?

3
  • Possible dublicates: stackoverflow.com/… Commented Aug 27, 2012 at 11:08
  • Post your relatively complete code of the method you are using. Commented Aug 27, 2012 at 11:13
  • Generally it's all. Except that I read data and set it to the view. Commented Aug 27, 2012 at 11:17

1 Answer 1

2

Per the book, you can either

1) specify the $paginate variable in the controller (not within an action):

public $paginate = array();

or 2) just put it in one array instead of two:

    $this->paginate = array(
         'limit' => 5,
         'conditions' => array(
            'name LIKE' => '%a'
         )
    );

or 3) use $paginate instead of $this->paginate on the second reference:

$paginate['conditions'] = array(
   'name LIKE' => '%a'
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.