Ejemplo n.º 1
0
 /**
  * Install the model blueprints.
  * @return void
  */
 public function boot_models(Extender $extender)
 {
     FieldBlueprint::boot();
     foreach ($extender->getModules() as $class => $module) {
         $name = "{$module->name}.config.php";
         if (file_exists(base_path("cms/conf/{$name}"))) {
             include base_path("cms/conf/{$name}");
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Create a new field object.
  * @param $name string
  * @param $arguments array
  * @return FieldBlueprint
  */
 protected function createField($name, $arguments)
 {
     $label = array_get($arguments, 0);
     $fieldType = array_get($arguments, 1);
     $fieldArgs = null;
     $inputType = array_get($arguments, 2);
     $inputOpts = array_get($arguments, 3);
     if (is_array($fieldType)) {
         list($fieldType, $fieldArgs) = $fieldType;
     }
     $field = FieldBlueprint::create($name, $fieldType, $fieldArgs, $this)->withInput($label, $inputType, $this->fields->count(), $inputOpts);
     if ($fieldType === FieldBlueprint::TITLE) {
         $this->title = $field;
     }
     return $this->fields[$name] = $field;
 }