require_once _PS_MODULE_DIR_.'authorpages/classes/Author.php'; class AdminAuthorPagesAuthorController extends ModuleAdminController { public function __construct() { $this->table = 'authorpages_author'; $this->className = 'AuthorPagesAuthor'; $this->identifier = 'id_author'; $this->lang = true; $this->bootstrap = true; parent::__construct(); $this->fields_list = [ 'id_author' => ['title' => 'ID'], 'name' => ['title' => 'Name', 'filter_key' => 'b!name'], 'active' => ['title' => 'Active', 'type' => 'bool', 'active' => 'status'], ]; } public function renderForm() { $this->fields_form = [ 'legend' => ['title' => $this->l('Author')], 'input' => [ ['type' => 'text', 'label' => 'Name', 'name' => 'name', 'lang' => true, 'required' => true], ['type' => 'textarea', 'label' => 'Description', 'name' => 'description', 'lang' => true], ['type' => 'file', 'label' => 'Image', 'name' => 'image'], ['type' => 'switch', 'label' => 'Active', 'name' => 'active', 'is_bool' => true, 'values' => [ ['id' => 'active_on', 'value' => 1, 'label' => 'Yes'], ['id' => 'active_off', 'value' => 0, 'label' => 'No'], ]], ], 'submit' => ['title' => 'Save'] ]; return parent::renderForm(); } }