Skip to end of metadata
Go to start of metadata

<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[

Zend Framework: Zend_Controller_Action Component Proposal

Proposed Component Name Zend_Controller_Action
Developer Notes
Proposers Aleksey V. Zapparov
Revision 1.1 - 9 January 2008: Initial propose (wiki revision: 13)

Table of Contents

1. Overview

The aim of this proposal is to give a simple way to load models according to Zend Framework code style standards.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

4. Dependencies on Other Framework Components

  • Zend_Loader

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)

9. Class Skeletons



zend_controller zend_controller Delete
improvement improvement Delete
mvc mvc Delete
model model Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jan 09, 2008

    <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>

  2. Jan 09, 2008

    <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
    <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)

    Unknown macro: { $model_name .= '_' . ucfirst($request->getActionName()); }

    $model_name .= 'Model';
    Zend_Loader::loadClass($model_name, $this->_getMvcPath('models'));

    $model = new $model_name();
    if (!($model instanceof Zend_Controller_Model))

    Unknown macro: { throw new Zend_Controller_Action_Exception("Model $model_name is not subclass of Zend_Controller_Model"); }

    $this->model = $model;

    return $this->model;
    // ...skipped...

  3. May 24, 2008

    <p>Seems like this has to be in issue tracker not here. Sorry.</p>