/** * Override of CAction's construct; all child classes need to have the * behavior {@link UpdaterBehavior} attached and enabled. * * @param type $controller * @param type $id */ public function __construct($controller, $id) { parent::__construct($controller, $id); $this->attachBehaviors($this->behaviors()); // Be certain we can continue safely: $this->requireDependencies(); }
public function __construct($controller = null, $id = null) { parent::__construct($controller, $id); Yii::app()->request->updateNavigationStack(); // Make sure viewHelper can be autoloaded Yii::import('application.helpers.viewHelper'); }
/** * Needed to override the constructor to make this automatically attach * behaviors listed in the {@link X2TranslationAction::behaviors} function. * @param CController $controller The controller who owns this action. * @param string $action The ID of the action. */ public function __construct($controller, $action) { $this->attachBehaviors($this->behaviors()); // Automatically attach all behaviors defined in behaviors method. parent::__construct($controller, $action); // Call parent constructor, nothing else to do. }
public function __construct($controller, $id, $target_id = null) { $requestedTarget = Yii::app()->request->getParam('target_id', FALSE); if (!$this->target_id && $requestedTarget) { $this->target_id = $requestedTarget; } elseif (!$this->target_id && $target_id) { $this->target_id = $target_id; } else { throw new CException('target_id should be specified'); } $this->user_id = !Yii::app()->user->isGuest ? Yii::app()->user->id : 0; parent::__construct($controller, $id); }
public function __construct($controller, $id) { parent::__construct($controller, $id); // Make sure viewHelper can be autoloaded Yii::import('application.helpers.viewHelper'); }