Can you help with the following problem?
I would like to know how I can insert comments to my module.
I have followed the following steps:
my_new_root_model:
- Model:
- DbTable:
- my_new_models -> extends Engine_Db_Table
- my_new_model -> extends Core_Model_Item_Abstract
with functions comments and likes - controllers:
- my_new_model_controller -> extends Core_Controller_Action_Standard
init:
public function init() { // Get subject $mynewmodel = null; $mynewmodel_id = $this->_getParam('mynewmodel_id', $this->_getParam('id', null)); if(!$mynewmodel_id) $mynewmodel = DEFAULT_VALUE; if( !$this->_helper->requireAuth()->setAuthParams('mynewrootmodel_mynewmodel', null, 'view')->isValid() ) return; $mynewmodel = Engine_Api::_()->getItem('mynewrootmodel_mynewmodel', $mynewmodel); if( $mynewmodel ) { Engine_Api::_()->core()->setSubject($mynewmodel); } // Require subject if( !$this->_helper->requireSubject()->isValid() ) { return; } }
- my_new_model_controller -> extends Core_Controller_Action_Standard
- scripts:
- mynewmodel:
- mynewmodel.tpl
echo $this->action("list", "comment", "core", array("type"=>"mynewrootmodel_mynewmodel", "id"=>$this->mynewmodel->mynewmodel_id))
- mynewmodel:
In DB:
engine4_authorization_permissions:
__level_id type name value params__
__5 mynewrootmodel_mynewmodel view 1 NULL__
__5 mynewrootmodel_mynewmodel comment 1 NULL__
engine4_authorization_allow:
__resource_type resource_id action role role_id value params__
__mynewrootmodel_mynewmodel *id* view everyone 5 1 NULL__
__mynewrootmodel_mynewmodel *id* comment everyone 5 1 NULL__
I've got the information of modules as Album, Photo and Video
This code don't work.
What steps should I take to insert comments in my module?
Thanks