public function init($tag = 'div')
 {
     Asserts::register($this->getView());
     $this->_tag = $tag;
     \Yii::$app->view->registerJs('var persisthide = "' . $this->id . '"', \yii\web\View::POS_HEAD);
     parent::init();
 }
Beispiel #2
0
 public static function CheckWords($String, $Limite, $Pointer = null)
 {
     self::$Data = strip_tags(trim($String));
     self::$Format = (int) $Limite;
     $ArrWords = explode(' ', self::$Data);
     $NumWords = count($ArrWords);
     $NewWords = implode(' ', array_slice($ArrWords, 0, self::$Format));
     $Pointer = empty($Pointer) ? '...' : ' ' . $Pointer;
     $Result = self::$Format < $NumWords ? $NewWords . $Pointer : self::$Data;
     return $Result;
 }
 public function ModelUpdate($id, array $dados)
 {
     $this->motorista = (int) $id;
     $this->data = $dados;
     $this->data['motorista_nome_url'] = Asserts::CheckName($this->data['motorista_nome']);
     $update = new Update();
     $update->Updater(self::Entity, $this->data, 'where motorista_id = :id', "id={$this->motorista}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
 public function ModelUpdate($id, array $dados)
 {
     $this->aluno = (int) $id;
     $this->data = $dados;
     $this->data['aluno_nome_url'] = Asserts::CheckName($this->data['aluno_nome']);
     $this->data['aluno_nascimento'] = date('Y-m-d', strtotime(str_replace(array('/', '_'), '-', $this->data['aluno_nascimento'])));
     $update = new Update();
     $update->Updater(self::Entity, $this->data, 'where aluno_id = :id', "id={$this->aluno}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
 public function ModelCreator(array $data)
 {
     $this->data = $data;
     $this->data['instituicao_nome_url'] = Asserts::CheckName($this->data['instituicao_nome']);
     $create = new Create();
     $create->Inserter(self::Entity, $this->data);
     if ($create->getResult()) {
         $this->result = $create->getResult();
         $this->rowcount = $create->getRowCount();
         $this->lastid = $create->getLastId();
     } else {
         $this->result = $create->getResult();
         $this->rowcount = 0;
         $this->lastid = false;
     }
 }