<?php
namespace Extension;
 use TCMS\ControlExtension;
 use TCMS\TException;
 class FormLayoutDefault extends ControlExtension {
 public $option = [ 'isCreatePage' => true, 'model' => null, 'backUrl' => '' ];
 public function render($fields, $option = null) {
 if(empty($option['model'])) {
 throw new TException('Vui lòng truyền option model cho extension form-layout', 501);
 }
 copy_option($this->option, $option);
 $this->view->fields = $fields;
 return $this->view('index', $this->option);
 }
 }
 ?>