html公共模板,数组方式传值,数据调用方式?

WBOY
Release: 2016-06-06 20:41:53
Original
1151 people have browsed it

有如下一段html放在公共模板中

<code><input type="text" name="$text_name" value="$data[$test_name]">
</code>
Copy after login
Copy after login

然后在通过如下方式调用复用

<code><include file="xxx.html $text_name=" info1></include>
<include file="xxx.html $text_name=" info2></include>
</code>
Copy after login
Copy after login

这样子在提交表单数据跟回显的时候是可以正常调用的
但是,我想要用数组方式传递数据,用如下方式调用

<code><include file="xxx.html $text_name=" info></include>
<include file="xxx.html $text_name=" info></include>
</code>
Copy after login
Copy after login

这样子在数据回显的时候就不懂得该怎么处理数据访问方式
想看看大家是怎么处理的[或者是其他更好的模板分离方式],谢谢

回复内容:

有如下一段html放在公共模板中

<code><input type="text" name="$text_name" value="$data[$test_name]">
</code>
Copy after login
Copy after login

然后在通过如下方式调用复用

<code><include file="xxx.html $text_name=" info1></include>
<include file="xxx.html $text_name=" info2></include>
</code>
Copy after login
Copy after login

这样子在提交表单数据跟回显的时候是可以正常调用的
但是,我想要用数组方式传递数据,用如下方式调用

<code><include file="xxx.html $text_name=" info></include>
<include file="xxx.html $text_name=" info></include>
</code>
Copy after login
Copy after login

这样子在数据回显的时候就不懂得该怎么处理数据访问方式
想看看大家是怎么处理的[或者是其他更好的模板分离方式],谢谢

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!