user2074836
user2074836

Reputation:

how to check which controller is calling pthml page in php

I have a page in UI that has some data set in it(a textbox) .
Now i need to check where this data is set from ?

My steps were :
1. Right click on elemnt in the browser.
2. Select "inspect element" .
3. From there, I managed to find the PHTML page that is actaully displaying the data I am searching for.
In the PHTML page, "$this->resources" does the job of holding data.

Now the question is , how can i find where this data is being SET ?
Obviously a controller will do that. So i had searched for "$this->view->resources" in my project to find the respective controller, but it didn't fetched me the exact result.

Any other tips other than what I am trying to do .

P.S I am using PHP ZEND framework.
Thanks for reading .

Regards,
Sagar

Upvotes: 0

Views: 399

Answers (2)

JocBro1
JocBro1

Reputation: 24

I think, you want get Controller and Action names?

Using:

Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
Zend_Controller_Front::getInstance()->getRequest()->getActionName();

Upvotes: 1

Mikhail Batcer
Mikhail Batcer

Reputation: 2065

In the same folder where 'view' folder with PHTML temlates is located, should be 'src' folder.

In it should be folder with the same name as your module.

In this folder should be the controller, with particular method (action) corresponding to your PHTML template. CamelCase in the action name maps to hyphenation in the template file name (CamelCaseAction => camel-case.phtml).

Upvotes: 0

Related Questions