Zend Framework, there is no corresponding to init (), after the end of the thing to execute xxxxx such a way
Source: Internet
Author: User
Zend Framework, there is no corresponding to the init (), after the end of the thing to execute xxxxx such a method?
PHP Rookie, description may not be accurate
There is an init () in each controller, which allows each action to execute it first.
Is there a way to get each action to be adjusted after it has been executed?
A little higher, that is, every action of the entire program will be adjusted after execution?
PHP register_shutdown_function can be recalled, but I want to know if Zend has encapsulated the above-mentioned mechanism?
If so, is the script executed just like register_shutdown_function? or something else?
Please do not hesitate to enlighten me ....
------Solution--------------------
Looks like, no, write a method call yourself
------Solution--------------------
"A little higher, is that the entire program is going to be tuned after every action is executed?"
What time is it? When the action is executed, the view is typically render, and then the output
Are you going to be before or after the render view? Before and after output?
What if the action redirect to another action?
------Solution--------------------
Yes, Predispatch and Postdispatch are the controllers in which each action is executed first and then executed, and if you want to run some code before each controller runs, it's also very simple, you just have to write a personal one that inherits the Zend_controller_ Action classes, such as Aacontroller, then write your requirements code in the class, and then you will run the class of your requirements code to inherit the Aacontroller. I hope I can help you.
------Solution--------------------
The upstairs is very good!
------Solution--------------------
This is the callback function.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.