S
S
Sergey Pugovkin2016-08-16 03:45:15
Yii
Sergey Pugovkin, 2016-08-16 03:45:15

Class not found... So how do you extend the Yii2 widget class?

I put the Breadcrumbs.php file into the components folder with the following content:

<?php
namespace app\components;
use yii\bootstrap\Html;
class Breadcrumbs extends \yii\widgets\Breadcrumbs
{
    ///
}

In the form I use the code:
<?php
use app\components\Breadcrumbs;
echo Breadcrumbs::widget([]);

Resulting in an error:
PHP Fatal error: Uncaught Error: Class 'app\components\Breadcrumbs' not found in ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-08-16
@Driver86

In the error app\components1
In the code namespace app\components;
something is wrong here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question