-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GridView can not load class with twig #3971
Comments
The issue will be fixed when I'll merge #3535 |
untill that time I can not use as I understand : )) I hope you gonna merge very soon : )) Do you know how can I use it with twig ??
|
I'm working on the merge right now. |
As I know, you can't use anonymous functions with twig at all. |
So how can I get status of the users with GridView ?? Like this <?php echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
//['class' => 'yii\grid\SerialColumn'],
//'id',
'username',
'email:email',
//'password_hash',
//'password_reset_token',
// 'auth_key',
[
'attribute' => 'status',
'value' => function ($model) {
return $model->getStatus();
}
],
'last_visit_time',
// 'create_time',
// 'update_time',
// 'delete_time',
['class' => 'yii\grid\ActionColumn'],
],
]); ?> |
Either configure it elsewhere or just use |
Thanx, I'll try : )) |
It works like this thanx again : ))
|
Should be like this when #3978 will be merged:
|
So what about this, I can not use layouts from another folder in my twig files with extends. Can you add this functionality too .. |
Still can not load class am I have to change anything else ??
An exception has been thrown during the rendering of a template ("Class yiigridActionColumn does not exist") |
You should use |
@grachov it was able to load both ways for me. |
@grachov it works thanx .. |
@samdark I'm not sure how it can be working, but as I know Twig uses |
Ah, I was talking about |
Hi How can I define this form in our new twig way ?? $form->field($model, 'status')->dropDownList([
User::STATUS_INACTIVE => $model->getStatus(User::STATUS_INACTIVE),
User::STATUS_ACTIVE => $model->getStatus(User::STATUS_ACTIVE),
User::STATUS_SUSPENDED => $model->getStatus(User::STATUS_SUSPENDED),
User::STATUS_DELETED => $model->getStatus(User::STATUS_DELETED),
]) in twig I dont know how can use "User::STATUS_SUSPENDED " like static calls .... and in my model there is a function getStatus .. So I want to call it too but with model.getStatus is firing an error too I think.. A hash key must be followed by a colon (:). Unexpected token "punctuation" of value "." ("punctuation" expected with value ":")
|
Hi My code is
I have added GridView as global in my config file like this
But I get this error and I can not use ActionColumn class ...
An exception has been thrown during the rendering of a template ("Class yiigridActionColumn does not exist") in "index.htm" at line 15.
Caused by: ReflectionException
Class yiigridActionColumn does not exist
in C:\EasyPHP\data\localweb\test\vendor\yiisoft\yii2\di\Container.php at line 408
So what's the problem over here ???
Regards,
The text was updated successfully, but these errors were encountered: