View Single Post
  #2 (permalink)  
Old 04-18-2008, 01:58 PM
Elemental's Avatar
Elemental Elemental is offline
Senior Member
 
Join Date: Jul 2007
Posts: 122
Default

You can create a new base controller class by extending Zend_Controller_Action. Put the new class file in your library under a folder named after your app.

MyApp/Controller/Action.php

PHP Code:
class MyApp_Controller_Action extends Zend_Controller_Action
{
    function 
getPages($section$page){ ... }

Then every controller you want to have access to this function extends your base controller instead of Zend's.

PHP Code:
class MyController extends MyApp_Controller_Action
{
    public function 
indexAction()
    {
        
$this->getPages(...)
    }

__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Reply With Quote