For example, I want to link to the home page in the navigation bar: & quot; {U (& #039; IndexIndex & #039;)} & quot; cannot be properly linked to the home page. Write it as follows: & quot; {: U (& #039; IndexIndex & #039;)} & quot; (a colon is added before the U method), I am in another place, in a form: & amp; lt; formaction & quot; metho... for example, I want to link to the home page in the navigation bar:
Written as follows: "{U ('index/Index ')}"
Cannot be correctly linked to the home page.
Write it as follows: "{: U ('index/Index ')}"
(That is, the colon is added before the U method)
However, I am in another place, in a form:
There is no problem if you do not add a colon Before the U method!
Why?
Reply content:
For example, I want to link to the home page in the navigation bar:
Written as follows: "{U ('index/Index ')}"
Cannot be correctly linked to the home page.
Write it as follows: "{: U ('index/Index ')}"
(That is, the colon is added before the U method)
However, I am in another place, in a form:
There is no problem if you do not add a colon Before the U method!
Why?
1,U()
Is the URL generation function in ThinkPHP.
2. In the template, use{:U('home/index')}
This method means:
3. If you only want to write{U('home/index')}
It should be understood as invalid (or it may be executed but no echo) and has not been tested; LZ says that adding a colon in form is okay. It may be because the write is invalid and nothing is output, so it becomes
In the form tag, if action is null, it is submitted to the current page by default. So ..
Link Description