Esempio n. 1
0
 /**
  * 
  * @param string $column Nome da Coluna
  * @param string/int  $selected Valor a ser selecionado
  * @param array  $options Valores a ser criado.<br/>Exemplo:<code>[1=>'Sim',2=>'Não']</code><br/>
  * @param array  $param Valores html que serar passado no <code><select></select></code>
  */
 public function dropDownListGroup($column, $selected = '', $options = [], $param = [])
 {
     $tag = Html::dropdowlist(self::$className . "[{$column}]", $selected, $options, array_merge(['id' => $column, 'class' => self::$classSelect], $param));
     if (self::$style) {
         return self::$style->grid($column, $tag, self::$labels[$column]);
     } else {
         return Html::label(self::$labels[$column]) . $tag;
     }
 }
Esempio n. 2
0
 /**
  *
  * @param  type $action
  * @return type
  */
 protected static function createActionColumns($action, $param, $id)
 {
     $i = 0;
     $count = count($action);
     $Action = [];
     $url = Controller::$baseUrl . '/' . Controller::$base;
     $actionColumn = ['update' => Html::a('editar', "{$url}/update/{$id}", ['class' => 'btn btn-info']), 'delete' => Html::a('deletar', "{$url}/delete/{$id}", ['class' => 'btn btn-danger', 'onclick' => "if(confirm('Deseja excluir esse item?')){return true;}else{return false;};"]), 'view' => Html::a('visualizar', "{$url}/view/{$id}", ['class' => 'btn btn-success'])];
     foreach ($action as $columns) {
         if (is_array($columns)) {
             $Action[] = $columns['container']($id);
         } else {
             while ($i < $count) {
                 $Action[] = $actionColumn[$action[$i]];
                 ++$i;
             }
         }
     }
     return implode(' ', $Action);
 }