<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
The aim of this proposal is to give a simple way to load models according to Zend Framework code style standards.Zend Framework: Zend_Controller_Action Component Proposal
Proposed Component Name
Zend_Controller_Action
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Controller_Action
Proposers
Aleksey V. Zapparov
Revision
1.1 - 9 January 2008: Initial propose (wiki revision: 13)
Table of Contents
1. Overview
2. References
Wikipedia resources
Similar proposal
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
5. Theory of Operation
The component is instantiated with a mind-link that it will make work parts of MVC pattern alltogether with unified style.
6. Milestones / Tasks
7. Class Index
- Zend_Controller_Action
8. Use Cases
| UC-01 (The simplest) |
|---|
3 Comments
comments.show.hideJan 09, 2008
Aleksey V. Zapparov
<p>This proposal can be used together with helper <ac:link><ri:page ri:content-title="Zend_Controller_Action_Helper_ModelLoader" /></ac:link> by analogy with Zend_Controller_Action::initView() and Zend_Controller_Action_Helper_ViewRenderer.</p>
Jan 09, 2008
Aleksey V. Zapparov
<p>Also, for future purposes, maybe there should be Zend_Controller_Model abstract class,</p>
<ac:macro ac:name="code"><ac:default-parameter>php</ac:default-parameter><ac:plain-text-body><![CDATA[
abstract class Zend_Controller_Model
{}
]]></ac:plain-text-body></ac:macro>
<p>so $this->initModel() could check whenever loaded class is instance of Zend_Controller_Model.</p>
<ac:macro ac:name="code"><ac:default-parameter>php</ac:default-parameter><ac:plain-text-body><![CDATA[
// ...skipped...
public function initModel($modelNameWithAction = false)
{
if (!isset($this->model)) { {
$request = $this->getRequest();
$model_name = ucfirst($request->getControllerName());
if ($modelNameWithAction)
$model_name .= 'Model';
Zend_Loader::loadClass($model_name, $this->_getMvcPath('models'));
$model = new $model_name();
if (!($model instanceof Zend_Controller_Model))
$this->model = $model;
}
return $this->model;
}
// ...skipped...
]]></ac:plain-text-body></ac:macro>
May 24, 2008
Aleksey V. Zapparov
<p>Seems like this has to be in issue tracker not here. Sorry.</p>