Hello,
I have a serious deadlock about my project. I am looking for a solution for days but there is nothing.
My index page have 4 different mysql queries. I tried to code this at first inside 1 controller and 1 view. It was not the right way. Then somebody suggested using 4 elements with requestAction() function. It was very good at first. Then I needed mysql between command. I could not found a way for it to use with requestAction(). My question on Cakephp group still unanswered. Somebody suggested using actions in controller. But I couldn't figure it out how to create that controller.
Please tell me what you know about it. Thanks in advance,
Here is my current post controller's index function:
function index() {
$posts = $this->paginate();
if (isset($this->params['requested'])) {
return $posts;
} else {
$sql = array( 'conditions' => array( 'id BETWEEN ? AND ?' => array( 286, 291 ) ) );
$this->Post->find('all', $sql);
$this->set('posts', $posts);
}
}
What should I do? Should I add a new controller for rest 3 actions? Or should I do something inside index() function?