What have I tried?
I have created CustomWidget
by extending Widget
class
In the end of run
method body I tried to place by different ways calling render method.
I have tried this ways
$this->render( '//widgets/custom' )
$this->render( 'custom' )
$this->render( '@frontend/views/widgets/custom' )
$this->renderFile(/*absolute path to file*/)
But all in vain.
And with another view, for example
$this->render('//site/404')
- Works
I thought maybe the problem the widget is searching for different directory than all other views.
I have overridden Widget
method getViewPath
and intentionally return path to my views. By default getViewPath
returns .../components/views.
But the error is still exists.
I have tried to place widget directory to components/views, but there is no result.
Piece of CustomWidget
code
class CustomWidget extends Widget {
public function run() {
return $this->render( '/widgets/custom' );
}
}
I'll be grateful for any clue, suggestion, advice about fixing this problem!
The problem is ftp and php users have different groups.
I created file via ftp and the file has different group than php user started with.
Changing group for the widgets/custom.php
and group for directory widgets
to appropriate to php
and set permission to 0770
fixed that issue.