opencart内的php基础有关问题$_[' ']

WBOY
Release: 2016-06-13 10:57:26
Original
810 people have browsed it

opencart内的php基础问题$_[' ']
语言包内的php代码:
$_['heading_title']='hello';

控制器:
$this->data['heading_title']=$this->language->get('heading_title');
视图:
将变成hello 

这里将语言包内的hello传递给视图内的变量$heading_titile;
这里的 $_[''] ,是什么意思?为什么可以用get('heading_title')来得到’hello‘为什么可以这样表示 $_ ?

------解决方案--------------------
$_ 是变量名

至于 为什么可以用get('heading_title')来得到’hello
可以去参考它的文档
------解决方案--------------------
language 是一个对象,就是你说的语言包
当访问语言包时 $this->language->get('heading_title')
实际访问的是 $_['heading_title']
内部实现请分析相关代码

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