예제 #1
0
 /**
  * Get column header.
  *
  * @return string
  */
 public function getHeader()
 {
     if ($header = $this->get('header')) {
         return Helpers::tryTranslate($header);
     }
     return $this->translate('columns') ?: $this->generateLabel();
 }
예제 #2
0
파일: BaseField.php 프로젝트: guratr/cruddy
 /**
  * Get field label.
  *
  * @return string
  */
 public function getLabel()
 {
     if ($label = $this->get('label')) {
         return Helpers::tryTranslate($label);
     }
     return $this->generateLabel();
 }
예제 #3
0
 /**
  * @param Action $action
  * @param mixed $model
  *
  * @return array
  */
 protected function exportAction(Action $action, $model)
 {
     $id = $action->getId();
     $title = Helpers::tryTranslate($action->getTitle($model));
     $disabled = $action->isDisabled($model);
     $state = $action->getState($model);
     return compact('id', 'title', 'disabled', 'state');
 }
예제 #4
0
파일: Enum.php 프로젝트: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['prompt' => Helpers::tryTranslate($this->get('prompt')), 'items' => $this->translateItems($this->getItems()), 'multiple' => $this->get('multiple', false)] + parent::toArray();
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['input_type' => $this->inputType(), 'placeholder' => Helpers::tryTranslate($this->get('placeholder'))] + parent::toArray();
 }
예제 #6
0
파일: Entry.php 프로젝트: guratr/cruddy
 /**
  * Get a help string for the attribute.
  *
  * @return string
  */
 public function getHelp()
 {
     $help = $this->get('help');
     return $help ? Helpers::tryTranslate($help) : $this->translate('help');
 }
예제 #7
0
파일: BaseInput.php 프로젝트: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['append' => Helpers::tryTranslate($this->get('append')), 'prepend' => Helpers::tryTranslate($this->get('prepend'))] + parent::toArray();
 }
예제 #8
0
파일: Text.php 프로젝트: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['contents' => Helpers::tryTranslate($this->contents)] + parent::toArray();
 }
예제 #9
0
파일: Fieldset.php 프로젝트: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['title' => Helpers::tryTranslate($this->title)] + parent::toArray();
 }