I want to create a new class that extend from yii2 Kartik gridview
namespace mywidget\grid;
use kartik\base\Config;
use kartik\dialog\Dialog;
use kartik\mpdf\Pdf;
use Yii;
use yii\base\InvalidConfigException;
use yii\bootstrap\ButtonDropdown;
use yii\grid\Column;
use kartik\grid\GridView as YiiGridView;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\Url;
use yii\web\JsExpression;
use yii\web\View;
use yii\widgets\Pjax;
class GridView extends YiiGridView
{
}
the problem is when i call grid view , an error exception is thrown : Class not found. So i wonder if it'is the right way to extend from a widget class ??
it sounds like it's an autoloading issue, make sure the file you're working in has the same path in your project as the namespace you're using. in this case should be
mywidget\grid\GridView.php
or adjust your namespace to match your file location.. if that's not the case please provide more details about the error you're receiving and use case of your class