public static function register($view)
 {
     if ($view instanceof \yii\base\View) {
         static::$_view = $view;
         static::$_module = static::$_view->context->module->id;
     } else {
         throw new \yii\base\NotSupportedException('invalid view object');
     }
 }
Esempio n. 2
0
 /**
  * Init helper
  *
  * @param \Engine\Crud\Grid\Extjs|\Engine\Crud\Form\Extjs $element
  * @return string
  */
 public static function init($element)
 {
     static::$_module = \Phalcon\Text::camelize($element->getModuleName());
     static::$_prefix = \Phalcon\Text::camelize($element->getKey());
 }
Esempio n. 3
0
 /**
  * constructor of the class
  *
  * @since 2.2.0
  *
  * @param array $module custom module setup
  */
 public function __construct($module = array())
 {
     if (is_array($module)) {
         static::$_module = array_merge(static::$_module, $module);
     }
 }