我正在使用 MTHAML和伊。我有以下几行。
-use yii\helpers\Url
%a{:href => Url::toRoute(['shopping/ping', 'id' => (string)$item->productId, 'category' => (string)$item->primaryCategory->categoryId])} test
但是它给出了一个错误。语法错误,意外的“使用”(T_USE)
<?php
function __MtHamlTemplate_65307eb071e28021db686cb46d491c8faae477235051858b05f212731637dd40($__variables)
{
extract($__variables);
?><?php use yii\helpers\Url; ?>
最佳答案
关于php - 如何在 Yii 和 HAML 中 `use` 命名空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29177591/