I want to access a controller action from ctp file. Here my action name and ctp file name is different. For example I created an action in the name of tickets ,and my view ctp file name is ticket_title. How to do this ?
This is my action : ticket
class UsersController extends AppController
{
public function ticket()
{
$ticket=$this->Tickets->find('all');
$this->set(compact('ticket'));
}
}
My view ctp file : ticket_title.ctp
<?php
$this->requestAction(array('controller' => 'users', 'action' => 'ticket'));
foreach($ticket as $ticket1)
{
echo $ticket1->title."<br/>";
}
Can any one help me ?.