/** * * */ public function __construct($formAction, $inputType, $title, $name, $params, $group, $database) { global $VNT; $formAction = Form::getFormActionToText($formAction); $this->id = $name . "__" . uniqid(); $this->type = $inputType; $this->name = $name; $this->title = $title; $this->params = $params; $this->action = $formAction; $this->root = Util::normalizePath($VNT->app->folder->inputs, $inputType); $this->config = Util::getYamlFile(Util::normalizePath($this->root, "config.yaml")); $this->events = $this->loadEvents(); //$this->html = $this->loadHtml(); //$this->jsInline = $this->loadJsInline(); //$this->jsHead = $this->loadJsHead(); //$this->jsFoot = $this->loadJsFoot(); //$this->jsStyle = $this->loadStyle(); $this->group = $group; $this->database = $database; }
use Vanuatu\Util; // // MOSTRA TELA DE ERRO PARA AÇÃO NÃO DEFINIDA // if (empty($VNT->fw->url->parameters->action)) { $errorPage = new Template(Util::normalizePath($VNT->app->folder->template, "error.phtml"), ["code" => Log::error(), "message" => "nenhuma ação definida"]); echo $errorPage; die; } // // EXECUTA AÇÕES // switch ($VNT->fw->url->parameters->action) { // // EXEMPLO DE URL // /view // /event:insert // /form:cadastro_pessoa // /path:group:dados_pessoais%3Einput:cpf // /file:people.yaml // case "view": echo $form = new Form(Form::getFormActionFromText($VNT->fw->url->parameters->event), $VNT->fw->url->parameters->file, $VNT->fw->url->parameters->form, $VNT->fw->url->parameters->path); break; // // case "exec": $form = new Form(Form::getFormActionFromText($VNT->fw->url->parameters->event), $VNT->fw->url->parameters->file, $VNT->fw->url->parameters->form, $VNT->fw->url->parameters->path, $_REQUEST); $form->execEvent(Form::VALIDATE); break; }