Creating a Zend Action Helper

Zend Action Helpers provide an easy way of extending the capabilities of Action Controllers, allowing you to extend Action Controller functionality only when it is needed. Zend Studio allows you to easily create and use Action Helpers within your Zend Framework projects.

For more information on Action Helpers, see http://devzone.zend.com/article/3350-Action-Helpers-in-Zend-Framework.

 

 

Instructions on how to complete a procedure

To create a new Zend Action Helper file:

  1. In PHP Explorer view, right-click the relevant helpers folder in your Zend Framework Project and select New | Zend Framework Item | Zend Action Helper.

  2. The New Zend Action Helper Wizard will be displayed.

zend_controller_new_action_helper.png

New Zend Controller Action Helper dialog

  1. The default location for the file will be in the application's default 'helper' folder.
    Click Browse next to the Source Folder field to change the location.

  2. Enter the Helper's name. This will be the name of the Helper file.
    The Helper's class name will be automatically created in the format <Helper's_Prefix>_<Helper's_Name>.

  3. Click Finish.

A new Zend Action Helper file will be created with the relevant template. This includes phpDoc block comments which help Zend Studio to recognize that the element is a Zend Action Helper.

Note:

Zend Action Helper phpDoc block comments must be in the format:
/**
* <Helper's_Name> Action Helper
*
* @uses actionHelper <Helper's_Prefix>
*/

All Zend Action Helpers in your project which are correctly commented will be available in the Code Assist list in Zend Controller files. This includes both the default Zend Action Helpers included in Zend Framework's libraries and the Actions Helpers you created.

zend_controller_code_assist.png

Zend Action Helper Code Assist - Example 1

The Helper broker for the Helper's members and methods are also available for Content Assist:

zend_controller_code_assist2.png

Zend Action Helper Code Assist - Example 2

In addition, pressing Ctrl and clicking on a Zend Action Helper in a Controller file will take you to the Zend Controller Action Helper's declaration.

zend_action_helper_goto.png

Zend View Helper Go To Source

 

 

link_icon.png

Related Links:
Zend Framework Integration

Integrating with Zend Framework

Creating Zend Framework Elements

Creating Zend Framework Projects

Creating a Zend Controller File