コード例 #1
0
ファイル: DynamicController.php プロジェクト: sodacms/sodacms
 public function __construct(ModelBuilder $modelBuilder)
 {
     $type = Route::current()->getParameter('type');
     $page_id = Route::current()->getParameter('page_id');
     $this->page = $page_id ? Page::find($page_id) : new Page();
     $block = $page_id ? $this->page->blocks() : new Block();
     $this->block = $block->with('type', 'type.fields')->where('identifier', $type)->first();
     $this->model = Soda::dynamicModel('soda_' . $this->block->type->identifier, $this->block->type->fields->lists('field_name')->toArray());
 }