pedrofp
(Pedrofp)
April 3, 2016, 1:06pm
1
In doing some updates to a backend theme (yii2-sb-admin-theme), I decided to use SideNavWidget. However I get
Class 'Yii\apidoc\templates\bootstrap\SideNavWidget' not found
Searching
vendor/yiisoft
in my Yii application fails to find the file.
My class declaration is…
class MetisNav extends yii\apidoc\templates\bootstrap\SideNavWidget
I also tried…
class MetisNav extends yii\bootstrap\SideNavWidget
as per the Nav & NavBar widgets. Same error.
So is this a bit of documented Yii functionality gone MIA?
pedrofp
(Pedrofp)
April 10, 2016, 5:48am
2
Looking a bit further into this…
I’ve learned what
yii2-apidoc
is, but this file looks like a complete misfit. The code looks like a Nav widget, the documentation looks like for a Nav widget, but the location,
yii\apidoc\templates
, seems wrong for it. Could this be a file misplaced?
softark
(Softark)
April 10, 2016, 7:08am
3
SideNavWidget seems to be a dedicated widget for yii2-apidoc extension. I’m not sure if it could be used in other places than API documentation projects.
Anyway, did you add yii2-apidoc in the required section of your project’s composer.json and execute “composer update”? I think it’s the minimum requirement that you have to fulfill before you try to use it.
jacmoe
(Jacob Moen)
April 10, 2016, 7:22am
4
It is probably the same widget that is in use by the new Yii site:
SideNav
softark
(Softark)
April 10, 2016, 7:36am
5
So, it seems to me that the simplest solution is to write your own SideNavWidget in your project.
You could copy/paste the SideNavWidget.php file to your "components" directory for example.
pedrofp
(Pedrofp)
April 10, 2016, 8:19am
6
softark:
So, it seems to me that the simplest solution is to write your own SideNavWidget in your project.
You could copy/paste the SideNavWidget.php file to your "components" directory for example.
That’s exactly what I had in mind to try