Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 向Smarty在Yii中注册AppAsset_Php_Yii_Smarty_Yii2 - Fatal编程技术网

Php 向Smarty在Yii中注册AppAsset

Php 向Smarty在Yii中注册AppAsset,php,yii,smarty,yii2,Php,Yii,Smarty,Yii2,我正在Smarty上使用Yi2,但注册AppAsset时遇到问题 在.PHP文件中执行以下代码: AppAsset::register($this); 在Smarty代码的注释中,我发现“use”语句如下: {use class="backend\assets\AppAsset"} 到目前为止,一切顺利。除了现在,我遇到的问题是将PHP代码翻译成与Smarty兼容的代码。这就是我现在拥有的: {AppAsset::register($this)} 不幸的是,这引发了一个错误 Object

我正在Smarty上使用Yi2,但注册AppAsset时遇到问题

在.PHP文件中执行以下代码:

AppAsset::register($this);
在Smarty代码的注释中,我发现“use”语句如下:

{use class="backend\assets\AppAsset"}
到目前为止,一切顺利。除了现在,我遇到的问题是将PHP代码翻译成与Smarty兼容的代码。这就是我现在拥有的:

{AppAsset::register($this)}
不幸的是,这引发了一个错误

Object of class backend\assets\AppAsset could not be converted to string
你知道我该怎么做吗


提前谢谢你

看看这里的资产部分:


这是指细枝部分。我正在尝试使用Smarty。滚动到Smarty部分:我是指RTFM
{use class="yii\web\JqueryAsset"}
{JqueryAsset::register($this)|void}