Форма с загрузкой файла
Создаем файл шаблона views/view-big-form.php и вносим маршрут к шаблону в файл config/routes.php
$mvFrontendRoutes = array( ... , "information-form/" => "view-big-form.php" ); <p
Содержимое файла шаблона
$fields = array( array("Название", "char", "name", array("min_max_length" => "3,20")), array("Email", "email", "email"), array("Телефон", "phone", "phone"), array("Цвет", "enum", "color", array("empty_value" => "Не выбран", "values_list" => array("blue" => "Синий", "red" => "Красный", "green" => "Зеленый", "white" => "Белый", "black" => "Черный", "orange" => "Оранжевый"))), array("Категория", "enum", "place", array("empty_value" => "Не выбрана", "values_list" => array("home" => "Дома и интерьер", "garden" => "Сад и огород", "sport" => "Спорт и отдых"))), array("Количество", "int", "number", array("positive" => true, "zero_allowed" => false)), array("Дата", "date", "date", array("display_selects" => 1, "years" => "2010, 2025")), array("Дата и время", "date_time", "date_time", array("display_selects" => 1, "years" => "2010, 2019")), array("Текстовое поле", "text", "message"), array("Файл", "file", "file", array("files_folder" => "form-files")), array("Изображение", "image", "image", array("files_folder" => "form-images")), array("Получать новости", "bool", "news") ); $form = new Form($fields); $form_complete = false; $form -> setRequiredFields("*") -> setDisplayRadio("place", 3); $form -> setDisplayTable("color", 2); $form -> useTokenCSRF(); if(!empty($_POST)) { $form -> getDataFromPost() -> validate(); if($form -> isValid()) $form_complete = true; } else $form -> setValue("date", I18n :: getCurrentDate()); include $mv -> views_path."main-header.php"; ?> <script type="text/javascript" src="<? echo $mv -> media_path; ?>js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("form .field-input span.delete").on("click", function() { $(this).parents("div.file-params").empty().next().show(); }); }); </script> <div id="container"> <? echo $form -> displayErrors(); if($form_complete) { echo "<h3>Результаты</h3>\n"; echo $form -> composeMessage(); $values = $form -> getAllValues(); Debug :: pre($values); } ?> <form action="<? echo $mv -> root_path; ?>information-form/" method="post" enctype="multipart/form-data"> <table> <? if(!$form_complete) echo $form -> setDisplayWithErrors() -> display(); ?> </table> <div class="form-submit"> <? echo $form -> displayTokenCSRF(); ?> <input type="submit" value="Отправить" /> </div> </form> </div> <? include $mv -> views_path."main-footer.php"; ?>