* @copyright (c), Thread */ class GroupMenu extends \thread\app\base\widgets\Widget { public $limit = 10; /** * @var null */ protected $items = null; /** * */ public function init() { parent::init(); $this->items = Group::find()->addOrderBy(['title' => SORT_ASC])->all(); } /** * */ public function run() { if ($this->items != null) { return $this->render('index', [ 'groups' => $this->items ]); } } }