K
K
Kolya Vantukh2017-01-26 14:48:21
Yii
Kolya Vantukh, 2017-01-26 14:48:21

Yii2 class not found. how to fix?

I downloaded the widget through composer from github. The widget is placed in the vendor folder
f464c6a9e2bb46fb8e41eb2476a3e4de.jpg
When trying to connect the widget, it gives an error Here is the code for connecting the widget
Class 'vkolya\poll\myPoll' not found

use vkolya\poll\myPoll;

echo myPoll::widget([
    'visualization' => 'PieChart',
        'pullName' => 'Do yoasdu wanna ?',
       
             'answerOptions'=>
             [
                 
                 'yesasddfs',
                 'sdnsdfo',
                 'masdysdfbe',
                 
             ],
            'diagrammsOptions' => array(title => 'My Dailsdy Activity',
                    height => 300,
                    width => 450,
               
                ),
])

myPoll class
namespace vkolya\poll;

class myPoll extends Widget {
   //some code..
  }

The code editor itself sees this class and successfully switches to it, but the browser swears. What's the matter ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Abdula Magomedov, 2017-01-26
@vkolya

d4be6112ff3e4670afb4ee6b2897e7c1.png
here, if I'm not mistaken, the path must match the namespace.
"psr-4": { "vkolya\\poll\\": "" }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question