E
E
evilelf2015-10-04 12:01:16
Yii
evilelf, 2015-10-04 12:01:16

How to access widget class from widget view?

Hello!
Yii 1.1.16
Need to call from widget view to widget class and call abc() method
How to do it?
$this->abc() not working
$this->getOwner()->abc() not working
Thanks everyone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-10-04
@matperez

It seems to me that this is not a good practice, it is better to pass data completely ready for display to the view, without having to go somewhere else. If you really want to, you can pass the widget instance directly to the view like this: $this->render('view', ['widget' => $this]), well, access it via $widget->abc() .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question