For example, I want to link to the homepage in the navigation:
Written in this way: "{U (' Index/index ')}"
cannot be linked correctly to the homepage.
Written like this: "{: U (' Index/index ')}"
(That is, the U method is preceded by a colon)
But I'm in another place, in a form form:
U method before adding a colon no problem!
Why is that?
Reply content:
For example, I want to link to the homepage in the navigation:
Written in this way: "{U (' Index/index ')}"
cannot be linked correctly to the homepage.
Written like this: "{: U (' Index/index ')}"
(That is, the U method is preceded by a colon)
But I'm in another place, in a form form:
U method before adding a colon no problem!
Why is that?
1, U()
is the function that generates the URL in the thinkphp
2, in the template, the use of {:U('home/index')}
this method means:
3, if only write {U('home/index')}
should be understood as invalid (also may be executed but not echo), not specifically tested, and LZ said in the form without a colon is not a problem may be because this write invalid, no output anything, so it becomes
, In the form tag, the action is empty and is submitted to the current page by default. So..
Link description