S
S
Sergey Beloventsev2016-07-15 10:42:03
Yii
Sergey Beloventsev, 2016-07-15 10:42:03

What's wrong with creating a widget?

this is how i use it in the view

use frontend\widget\wath\Wath;
<?= Wath::widget(['serial'=>$model,'theSerial'=>0,'class'=>'film']); ?>

like this in Wath.php itself
class Wath extends Widget{
    public $serial;
    public $theSerial;
    public $class;
    public function init()
    {
        parent::init();
    }
    public function run(){
    {return var_dump($this->class);}
    }

gives null, but if $this->serial then gives out what comes 'serial'=>$model

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-07-15
@Sergalas

if the widget does nothing more with this parameter, then most likely there is a typo in the word "class" somewhere (Russian letter "c")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question