Jump to content
Sign in to follow this  
Alfraganus

issue with Yii 2 framework

Recommended Posts

I was trying to make a blog with YII2,  my framework is confusing to call data from database.

For example when I call "username" from "user" table,

<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
   'user.fullname',     --->> Yii2 is thinking that this is a category and not a user table
        'title',
        'description',
        'content:html',
        'count_view',
        'status',
        'created_at',
    ],
]) ?>

I am getting this error:  -->>  unknown property: app\models\Category::fullname 

please could you help me to solve this issue, where I did make a mistake?

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×