Удалось добавить новый модуль. Добавлена модель и один контроллер
в модель пишу следующий код:
class testmodule_Model
{
protected $_modelName = 'testmodule';
public $img = 1;
/**
* One-to-many or many-to-many relations
* @var array
*/
protected $_hasMany = array();
/**
* Belongs to relations
* @var array
*/
protected $_belongsTo = array();
/**
* Constructor.
*/
public function __construct($id = NULL)
{
parent::__construct($id);
/*if (is_null($id))
{
$oUserCurrent = Core_Entity::factory('User', 0)->getCurrent();
$this->_preloadValues['user_id'] = is_null($oUserCurrent) ? 0 : $oUserCurrent->id;
$this->_preloadValues['site_id'] = defined('CURRENT_SITE') ? CURRENT_SITE : 0;
}*/
}
public function getModules()
{
/* $this->queryBuilder()
->clear()
->select('*')
->from('testmodule_modules_type')
;
$testmoduleModules = $this->findAll();
if (isset($testmoduleModules[0]))
{
return $testmoduleModules[0];
}*/
return array('1' => 'fdsaDSd');
}
забил пока заглушку возврат массива.
далее в папке "controller" разместил файл "show.php"
код
class testmodule_Controller_Show extends Core_Controller
{
//$otestmodule_Model = new testmodule_Model();
public function __construct(testmodule_Model $otestmodule)
{
parent::__construct($otestmodule);
}
public function execute()
{
return array('sdsds'=>'sdsdsd');//$otestmodule_Model->getModules();
}
}
в /admin/testmodule поместил файл index.php взятый от типографа. изменил как нужно, вставляю код для получения данных пока просто от контроллера
$oFieldManager_Controller_Show = new FieldManager_Controller_Show();
$modules = $oFieldManager_Controller_Show->execute();
при этом нужно передать некий параметр в конструктор. на других страницах конструкции в роде
$oAdmin_Form_Action = Core_Entity::factory('Admin_Form', 141)
->Admin_Form_Actions
->getByName('show');
$oAdmin_Form_Action передается в качестве параметра. Судя по всему берется экземпляр формы центра администрирования. Подскажите что передать, пока что я просто хочу получить данные от модели.