How to get Module and Action name

25 views
Skip to first unread message

Ravinder

unread,
Apr 11, 2012, 9:52:00 AM4/11/12
to diem-users
Hi All,

How do i get Module and Action name of a particular page.
When i tried using $this->getContext()->getModuleName(); to get module
name the output id "dmFront"
and for Action $this->getContext()->getActionName(); and the output
is "page". but they are not correct.


Actually my requirement is Creating an SSL Redirect filter for some
specific pages
i have gone through the below link to accomplish it.
http://blog.tigregroup.com/programming/creating-an-ssl-redirect-filter-in-symfony/


I have added code in app.yml file as mentioned in the above blog
secure:
main: // module name
actions:
[myDashboard,accountSignIn,registration] // actions


but for each and every page i am getting module name is "dmFront "
and Action is "page" so the redirection is not working.

Can some please help to solve this.








Stéphane

unread,
Apr 11, 2012, 10:38:41 AM4/11/12
to diem-...@googlegroups.com
YOu have to ask the question to the DmPage object rather than asking the *actual* handling action.

dmFront/page is the action executed *whatever* happens.

In DmPage objects, you can configure which module/action to execute.

If  you want to do something in between, I guess you'll have to add a filter *after* dmInit filter (so you'll have access to the current page via sfContext or such, can't remember exactly).

Regards,
Reply all
Reply to author
Forward
0 new messages