Files
LE_FRAMEWORK/MODULES/main/ui_test.php
indeferend df825e3d2f Draft v1
2021-05-23 06:26:34 +05:00

33 lines
996 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/*
1. Подключить нужные для модуля классы и конфиги
2. Определить какой метод контроллера выполнить и запустить его
3. Внутри метода идет вывод или запись данных, при выводе передается в шаблон
4. Содержимое
*/
//compute
//if (isset($_POST)) echo_arr($_POST);
//if (isset($_FILES)) echo_arr($_FILES);
if (isset($_FILES['upl_img']))
{
$uploaddir = WEBDIR.'pub_data/upload/img/';
$f_name=basename($_FILES['upl_img']['name']);
$uploadfile = $uploaddir . basename($_FILES['upl_img']['name']);
if (move_uploaded_file($_FILES['upl_img']['tmp_name'], $uploadfile))
{
$out = ['success'=>1];
$out['data'] = ['url'=>'/pub_data/upload/img/'.$f_name];
$mod_out = json_encode($out);
}
}
else
$mod_out = LE::$TPL->fetch('le_ui_kit/test1');
//out to tpl
LE::$TPL->mod_cont .= $mod_out;