Php 向Smarty在Yii中注册AppAsset
我正在Smarty上使用Yi2,但注册AppAsset时遇到问题 在.PHP文件中执行以下代码: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
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}