コード例 #1
0
ファイル: CrudRenderer.php プロジェクト: laravader/cms
 public function load($crudClass)
 {
     $this->crudClass = Vector::getLastSplited($crudClass, "\\");
     $this->computedMenus = MenuBuilder::getInstance()->get();
     $this->loadPageTitle();
     $this->loadPageBreadcrumbs();
     $this->loadRoutes();
 }
コード例 #2
0
ファイル: Form.php プロジェクト: laravader/cms
 /**
  * Return all merge attributes to update fields
  *
  * @param string $column
  * @param array $formCustomFields
  * @param array $rowData
  * @return \Illuminate\Support\Collection
  */
 protected function getUpdateAttributes($column, $formCustomFields, $rowData)
 {
     $collection = collect(array_merge(Vector::findOrEmptyArray($formCustomFields, $column), Vector::findOrEmptyArray($rowData, $column)));
     return $collection->merge($collection->get("update", []));
 }
コード例 #3
0
ファイル: Select.php プロジェクト: laravader/cms
 /**
  * Return the list of options
  *
  * @return array
  */
 private function getOptions()
 {
     $this->selectedValue = $this->selectedValue ?: $this->getValue();
     if (!empty($this->table)) {
         return $this->getTableOptions();
     }
     if (!Vector::isAssociative($this->options)) {
         $this->options = Vector::toAssociative($this->options);
     }
     $options = collect();
     foreach ($this->options as $optionValue => $optionText) {
         $options->push($this->createOption($optionValue, $optionText));
     }
     return $options->toArray();
 }
コード例 #4
0
 public static function build($columnName, $overrides, $defaultProperties)
 {
     $field = Factory::createField($columnName, Vector::findOrEmpty($overrides, 'type'));
     return collect(['align' => 'left', 'label' => String::labelize($columnName), 'width' => null, 'order' => $defaultProperties['order'], 'filter' => $defaultProperties['filter'], 'name' => $columnName])->merge($overrides)->merge(['type' => $field])->toArray();
 }