Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-10-2008, 03:09 PM
Elf Elf is offline
Junior Member
 
Join Date: Feb 2008
Posts: 1
Default Overriding Default Behaviour

I’ve been playing round with the ZF for a while and wanted to create an app. using it but with a few changes to the default behaviour. The basic requirements are as follows:

• All but a few pages on the site will be handled the same way – but they could have arbitrary URLS
• It is to use Zend_Layout as its master view
• The conventional behaviour for finding controllers and views is to be overridden
• The Directory structure is something like (note this is just an example):

/application
..myapp
....Catchall
Controller.php
....Error
Controller.php
....Page
Controller.php
Page.php
....Views
..config
config.xml
..layout
....common
header.inc.php
footer.inc.php
master.php
/library
..mylibrary
/web
index.php


It needs to abandon the default behaviour of looking straight under a controller directory for a controller named after what is has got from the Request object – i.e. /news/list will not map to a NewsController with a listAction method.

Likewise the view script naming conventions are not to be determined from the controller. These will be looked up from a database.

The question is how do I cleanly override this default behaviour, without putting the same code in each controller I need to create?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-26-2008, 05:11 AM
Junior Member
 
Join Date: Mar 2008
Posts: 5
Default

Why don't you just use Zend_Controller_Router_Rewrite?
Zend Framework: Documentation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:23 PM.