Cainiao asks zendframwork for simple guidance

Source: Internet
Author: User

Xxx. phtml file and aaacontroller. the xxxaction () method in the PHP file seems to be bound. Is there such a possibility? xxx. in phtml, the form action can specify aaacontroller. the execution of the function specified in PHP, because xxxaction () will follow XXX. phtml is loaded and executed, which cannot be controlled. Return to the homepage of the IT Website>

-------- Solution --------
You are dizzy .. AAA/xxx of aaacontroller xxxaction or something will display XXX. phtml In the AAA folder by default
If you use render ('zzz'), it will display zzz. phtml. AAA/XXX, which is equivalent to a simple PHP class aaacontroller.
You can write a lot of action frameworks and it feels more orderly to develop them .. I have just been in touch with PHP (for more than two months). They are all used while watching...
-------- Solution --------
Directly write the method in the controller, and receive the post or get data processing submitted by the form.
-------- Solution --------
Thanks to the two upstairs. To be honest, I am also a little dizzy. Just simplify the problem. In. there is a form in phtml. Action = is followed by the Action Function in the specified controller.
-------- Solution --------
In fact, when zendframwork is created in zendstudio, an indexcontroller will be created under application-> controller. PHP file, which corresponds to an index under View> scripts> index. phtml file, right. the phtml content is changed to a form, and the Action path is not written (it should be handled by PHP on this page). Is there any way to make this form composed of indexcontroller. execution of a specified action function in PHP, indexcontroller. the two functions INI () and indexaction () in PHP will be executed even if no form is submitted.
-------- Solution --------
Action = "/indexcontroller/Up" indicates the Controller name and method name.
-------- Solution --------
Which page will the form go to after submission?
-------- Solution --------
For example, if you have a myaction in testcontroller, you will find the my. phtml page in the test folder in your views folder.
I haven't played ZF for a long time. I remember writing it like this. You can use $ this-> baseurl () in phtml to obtain the root directory.
Actions can be written in this way. Action = "<? PHP echo $ this-> baseurl ()?> /Test/my ". This means to call myaction in testcontroller, that is, find my in the test folder in the Views folder. phtml page (of course, this is the default situation, and there is only one module, if there are multiple modules or you have set the call non-default page in the action ).
-------- Solution --------
Thank you, a82168506. You have already solved this problem. After trying it out, you can find out the entire process. Thank you very much for your guidance!
The article comes from the IT field

Xxx. phtml file and aaacontroller. the xxxaction () method in the PHP file seems to be bound. Is there such a possibility? xxx. in phtml, the form action can specify aaacontroller. the execution of the function specified in PHP, because xxxaction () will follow XXX. phtml is loaded and executed, which cannot be controlled. Return to the homepage of the IT Website>

-------- Solution --------
You are dizzy .. AAA/xxx of aaacontroller xxxaction or something will display XXX. phtml In the AAA folder by default
If you use render ('zzz'), it will display zzz. phtml. AAA/XXX, which is equivalent to a simple PHP class aaacontroller.
You can write a lot of action frameworks and it feels more orderly to develop them .. I have just been in touch with PHP (for more than two months). They are all used while watching...
-------- Solution --------
Directly write the method in the controller, and receive the post or get data processing submitted by the form.
-------- Solution --------
Thanks to the two upstairs. To be honest, I am also a little dizzy. Just simplify the problem. In. there is a form in phtml. Action = is followed by the Action Function in the specified controller.
-------- Solution --------
In fact, when zendframwork is created in zendstudio, an indexcontroller will be created under application-> controller. PHP file, which corresponds to an index under View> scripts> index. phtml file, right. the phtml content is changed to a form, and the Action path is not written (it should be handled by PHP on this page). Is there any way to make this form composed of indexcontroller. execution of a specified action function in PHP, indexcontroller. the two functions INI () and indexaction () in PHP will be executed even if no form is submitted.
-------- Solution --------
Action = "/indexcontroller/Up" indicates the Controller name and method name.
-------- Solution --------
Which page will the form go to after submission?
-------- Solution --------
For example, if you have a myaction in testcontroller, you will find the my. phtml page in the test folder in your views folder.
I haven't played ZF for a long time. I remember writing it like this. You can use $ this-> baseurl () in phtml to obtain the root directory.
Actions can be written in this way. Action = "<? PHP echo $ this-> baseurl ()?> /Test/my ". This means to call myaction in testcontroller, that is, find my in the test folder in the Views folder. phtml page (of course, this is the default situation, and there is only one module, if there are multiple modules or you have set the call non-default page in the action ).
-------- Solution --------
Thank you, a82168506. You have already solved this problem. After trying it out, you can find out the entire process. Thank you very much for your guidance!
Article source from it http://www.itjie.wang/phpframework/443107.html

Cainiao asks zendframwork for simple guidance

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.