rendered paste body <sandbox> <crud> <routes> <route name=".add" pattern="^/add$" Module="Crud" action="Add" /> <route name=".edit" pattern="^/edit/(id:\d+)$" Module="Crud" action="Edit" /> <route name=".manage" pattern="^/manage$" Module="Crud" action="Manage" /> <route name=".delete" pattern="^/delete/(id:\d+)$" Module="Crud" action="Delete" /> </routes> </crud> </sandbox> <route name=".products" pattern="^/products" module="Products"> <routes> <xi:include xpointer="xpointer(/configurations/sandbox/crud/routes/route)" /> </routes> </route> <route name=".promotions" pattern="^/promotions" module="Promotions"> <routes> <xi:include xpointer="xpointer(/configurations/sandbox/crud/routes/route)" /> </routes> </route> class Crud_AddAction extends CustomBaseAction{ public function getCredentials() { return "{$this->modelName}.add"; } public function isSecure() { return true; } public function executeWrite(AgaviRequestDataHolder $rd) { # 1. find out Model we are dealing with, eg. Products/Promotions, in BaseAction $model = new $this->modelName; try { $model->add($rd->getParameter('form')); $this->flash("Added {$this->modelName}!"); $return = 'Success'; } catch(Exception $e) { $return = 'Error'; $this->flash($e->getMessage()); } return array($this->modelName,"Add".$return); # eg. Products,AddSuccess }}