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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-18-2008, 09:02 AM
Junior Member
 
Join Date: Apr 2008
Posts: 7
Default Identifying primary invoked action

Hi guys,

I have the following question: How to identify which action/controller was initially invoked? So I can determine which actions has been called via _forward or with action stack helper. Basically if I have the following helper:

PHP Code:
class Controller_Plugin_Test extends Zend_Controller_Plugin_Abstract 
{
    public function 
preDispatch(Zend_Controller_Request_Abstract $request)
    {
        
$action $this->getRequest()->getActionName();        
    }

in the preDispatch method I would like to know if this was the primary/originate action requested or it was forwarded. I try to use isDispatched() but seems it has different meaning from one I thought.

Any ideas how to recognize this?

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 01:47 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

each time the dispatcher dispatches an action the module, controller, action are stored in the params array and are available to the controller via $this->_request->getParam('controller') and the like. You could create an array and push this info to that array to track the call history and stash this array in the session or registry or something.
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 02:58 PM
Junior Member
 
Join Date: Apr 2008
Posts: 7
Default

Seems logical, but is there anyway to trick this? something on ZF
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 03:10 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

May getStack from the actionStack helper? I'm not very familiar with the actionStack helper...
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
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 11:45 AM.