mervick / yii2-mthaml

The MtHaml integration for the Yii2 framework.
MIT License
8 stars 1 forks source link

No way to use Yii helpers in HAML views #1

Closed starrychloe closed 9 years ago

starrychloe commented 9 years ago

http://stackoverflow.com/questions/29177591/how-do-i-use-a-namespace-in-yii-and-haml

I have the following lines.

-use yii\helpers\Url
%a{:href => Url::toRoute(['shopping/ping', 'id' => (string)$item->productId, 'category' => (string)$item->primaryCategory->categoryId])} test

However it gives an error.

syntax error, unexpected 'use' (T_USE)

<?php

function __MtHamlTemplate_65307eb071e28021db686cb46d491c8faae477235051858b05f212731637dd40($__variables)
{
    extract($__variables);
?><?php use yii\helpers\Url; ?>
mervick commented 9 years ago

Fixed on 0.1.3 release