[Cakephp] How to use Read()
- by kwokwai
Hi all,
In a Controller, I got this:
$this->Site1->post_id=$id;
$this->set('posts', $this->Site1->read());
And when I replaced it by this line of code:
$this-set('posts', $this-Site1-read('post_id', $id));
But the returned result is totally different.
Is there any difference between them?
Is it possible to make this two lines of code neat by re-writing it into one line of code?
$this->Site1->post_id=$id;
$this->set('posts', $this->Site1->read());