很多学ThinkPHP的新手会遇到的有关问题

WBOY
Release: 2016-06-13 12:01:37
Original
924 people have browsed it

很多学ThinkPHP的新手会遇到的问题

在模板传递变量的时候,很多视频教程都使用$v.channel的方式,如下:

这会导致URL在解析的时候出现问题,URL后面变成了id/Arraychannel.html

其实在TP手册变量输出那里,数组输出的时候除了使用上面的方式外还可以使用下面的方式:

$v['channel']

当我们要输出多维数组的时候,往往要采用这种方式。使用这种方式就不会出现前面的问题了


官方在线手册-变量输出地址:http://document.thinkphp.cn/manual_3_2.html#var_output
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!