class BoardController extends \Phalcon\Mvc\Controller
{
private function board_id_check($board_id)
{
if (false) {
$this->flash->error("Board does not exist");
$this->response->redirect('main');
}
}
public function viewAction($board_id)
{
$this->board_id_check($board_id);
}
public function listAction($board_id)
{
$this->board_id_check($board_id);
}
public function writeAction($board_id)
{
$this->board_id_check($board_id);
}
public function modifyAction($board_id)
{
$this->board_id_check($board_id);
}
}
Hello.
I think this way is inefficient. Is there a good way?
I'd like to deal with it at once.
thanks.