kartik\tree\TreeView::widget PHP Méthode

widget() public static méthode

public static widget ( $config = [] )
    public static function widget($config = [])
    {
        $config = self::getConfig($config);
        return parent::widget($config);
    }

Usage Example

Exemple #1
1
<?php
use kartik\tree\TreeView;
use app\models\Course;
use yii\helpers\html;
 
 $this->title = Yii::t('app', 'Course Manage');

echo TreeView::widget([
    // single query fetch to render the tree
    // use the Product model you have in the previous step
    'query' => Course::find()->addOrderBy('root, lft'), 
    'headingOptions' => ['label' => Yii::t('app', 'Contents')],
    'fontAwesome' => false,     // optional
    'isAdmin' => true,         // optional (toggle to enable admin mode)
    'displayValue' => 1,        // initial display value
    'softDelete' => true,       // defaults to true
    'cacheSettings' => [        
        'enableCache' => true   // defaults to true
    ]
]);
All Usage Examples Of kartik\tree\TreeView::widget