public function index($args) { $view = new \Core\View(); $this->load_locale("sample"); $view->set("sample", L_SAMPLE); $view->show("sample"); }
public function __construct($refresh = false) { if (defined('PHPFOX_NO_APPS')) { return; } $base = PHPFOX_DIR_SITE . 'Apps/'; if (!is_dir($base)) { return; } if (self::$_apps !== null && !$refresh) { return; } self::$_apps = []; foreach (scandir($base) as $app) { if ($app == '.' || $app == '..') { continue; } $path = $base . $app . '/'; if (!file_exists($path . 'app.lock')) { continue; } $jsonData = file_get_contents($path . 'app.json'); $jsonData = preg_replace_callback('/{{ ([a-zA-Z0-9_]+) }}/is', function ($matches) use($jsonData) { $_data = json_decode($jsonData); if (!isset($_data->{$matches[1]})) { return $matches[0]; } return $_data->{$matches[1]}; }, $jsonData); $data = json_decode($jsonData); $data->path = $path; if (isset($data->routes)) { foreach ((array) $data->routes as $key => $route) { $route = (array) $route; $route['id'] = $data->id; Route::$routes = array_merge(Route::$routes, [$key => $route]); } } self::$_apps[$data->id] = $data; \Core\Route\Controller::$active = $data->path; \Core\Route\Controller::$activeId = $data->id; $vendor = $data->path . 'vendor/autoload.php'; if (file_exists($vendor)) { require_once $vendor; } if (file_exists($data->path . 'start.php')) { $callback = (require_once $data->path . 'start.php'); if (is_callable($callback)) { $View = new \Core\View(); $View->loader()->addPath($data->path . 'views/', $data->id); call_user_func($callback, $this->get($data->id), $View->env()); } } } // d(self::$_apps); exit; }
/** * Can we call a View Helper and get the expected result? * * @access public */ public function testViewHelper() { // Load the config file Core\Config::load('MyProject'); // Get a new View $view = new Core\View(); // Load a View Helper $viewHelperContent = $view->test(array('testVar' => 'foo')); // And test $this->assertEquals($viewHelperContent, 'Test var: foo'); }
/** * Save user session and render the final layout template */ public function send() { //\Core\Session::save(); headers_sent() or header('Content-Type: text/html; charset=utf-8'); $layout = new \Core\View($this->template); $layout->set((array) $this); print $layout; $layout = NULL; if (config()->debug_mode) { print new \Core\View('System/Debug'); } }
public function initialize() { parent::initialize(); $this->view = view('layout/index.php'); $this->user = \Model\Authorize\Oauth::login_user(); \Core\View::$title = '文和友老长沙外卖'; }
public function process() { if (!defined('PHPFOX_ALLOW_MODE')) { exit; } $demoId = 0; if ($demoId = $this->request()->get('id')) { $Themes = new Core\Theme($demoId); Phpfox::setCookie('flavor_id', $demoId); $this->url()->send(''); } /* else { $this->url()->send(''); } */ Core\View::$template = 'blank'; $Themes = new Core\Theme(); $flavors = []; foreach ($Themes->all() as $Theme) { foreach ($Theme->flavors() as $Flavor) { $flavors[] = $Flavor; } } $this->template()->assign(['flavors' => $flavors, 'demoId' => $demoId]); }
public function __construct() { if (defined('PHPFOX_NO_APPS')) { return; } $base = PHPFOX_DIR_SITE . 'Apps/'; if (!is_dir($base)) { return; } foreach (scandir($base) as $app) { if ($app == '.' || $app == '..') { continue; } $path = $base . $app . '/'; if (!file_exists($path . 'app.lock')) { continue; } $data = json_decode(file_get_contents($path . 'app.json')); $data->path = $path; if (isset($data->routes)) { self::$routes = array_merge(self::$routes, (array) $data->routes); } $this->_apps[$data->id] = $data; \Core\Route\Controller::$active = $data->path; \Core\Route\Controller::$activeId = $data->id; $vendor = $data->path . 'vendor/autoload.php'; if (file_exists($vendor)) { require_once $vendor; } if (file_exists($data->path . 'start.php')) { $callback = (require_once $data->path . 'start.php'); if (is_callable($callback)) { $View = new \Core\View(); $View->loader()->addPath($data->path . 'views/', $data->id); call_user_func($callback, $this->get($data->id), $View->env()); } } } // d($this->_apps); exit; }
echo $afisha->name; ?> </a> <a class="flr export" href="/backend/cassier/export/<?php echo Core\Route::param('id'); ?> /<?php echo $afisha->id; ?> ">Экспорт в Excel</a> <span class="flr"> </span> <a class="flr printTable" href="#">Распечатать</a> </div> <div class="eventOrders"> <?php echo Core\View::tpl(array('result' => $value['orders'], 'afisha' => $afisha, 'pay_statuses' => $pay_statuses), $tpl_folder . '/Orders'); ?> </div> </div> <?php } ?> </div> </div> <?php echo $pager; ?> </div> </div> </div>
<div class="novelty clearFix"> <div class="fll"> <div class="new_pos">популярные<br>товары</div> <a href="<?php echo Core\HTML::link('popular'); ?> " class="slide_but"><span>пререйти в раздел</span></a> </div> <div class="flr"> <ul> <?php foreach ($result as $obj) { ?> <?php echo Core\View::tpl(array('obj' => $obj), 'Catalog/ListItemTemplate'); ?> <?php } ?> </ul> </div> </div>
<div class="rowSection"> <div class="col-md-12"> <div class="widget"> <div class="widgetContent"> <?php echo Core\View::tpl(array('creators' => array(), 'events' => $events), $tpl_folder . '/Filter'); ?> <div class="checkbox-wrap"> <?php foreach ($result as $key => $item) { ?> <?php $poster = $item['poster']; ?> <div style="margin-bottom: 20px;" class="eventWrapp"> <div class="eventName"> <a class="fll" href="/backend/afisha/edit/<?php echo $poster->id; ?> "><?php echo $poster->name; ?> </a> <a class="flr export" href="/backend/organizer/detailed_export/<?php echo $poster->id; ?> " target="_blank">Подробный отчет в Excel</a> <span class="flr"> </span> <a class="flr export" href="/backend/organizer/export/<?php
<?php if (isset($result[$cur]) and count($result[$cur])) { ?> <ul> <?php foreach ($result[$cur] as $obj) { ?> <li><a href="<?php echo Core\HTML::link($add . '/' . $obj->alias); ?> "><?php echo $obj->name; ?> </a> <?php echo Core\View::tpl(array('result' => $result, 'cur' => $obj->id, 'add' => $add), 'Sitemap/Recursive'); ?> </li> <?php } ?> </ul> <?php }
<?php if (count($result[$currentParent])) { ?> <?php foreach ($result[$currentParent] as $obj) { ?> <option value="<?php echo $obj->id; ?> " <?php echo $parentID == $obj->id ? 'selected' : ''; ?> ><?php echo $space . $obj->name; ?> </option> <?php echo Core\View::tpl(array('result' => $result, 'currentParent' => $obj->id, 'space' => $space . ' ', 'filename' => $filename, 'parentID' => $parentID, 'parentAlias' => $parentAlias), $filename); ?> <?php } ?> <?php }
Алиас <i class="fa-info-circle text-info bs-tooltip nav-hint" title="<b>Алиас (англ. alias - псевдоним)</b><br>Алиасы используются для короткого именования страниц. <br>Предположим, имеется страница с псевдонимом «<b>about</b>». Тогда для вывода этой страницы можно использовать или полную форму: <br><b>http://domain/?go=frontend&page=about</b><br>или сокращенную: <br><b>http://domain/about.html</b>"></i> </label> <div class="col-md-10"> <div class="input-group"> <input class="form-control translitConteiner valid" name="FORM[alias]" type="text" value="<?php echo $obj->alias; ?> " /> <span class="input-group-btn"> <button class="btn translitAction" type="button">Заполнить автоматически</button> </span> </div> </div> </div> </div> </div> </div> </div> </form> <?php if ($obj->type_id == 1) { ?> <?php echo Core\View::tpl(array('list' => $list), 'Specifications/ValuesColor'); } else { ?> <?php echo Core\View::tpl(array('list' => $list), 'Specifications/ValuesSimple'); }
?> "><?php echo $obj->name; ?> </a></td> <td><?php echo $obj->login; ?> </td> <td><?php echo $obj->created_at ? date('d.m.Y', $obj->created_at) : '----'; ?> </td> <td width="45" valign="top" class="icon-column status-column"> <?php echo Core\View::widget(array('status' => $obj->status, 'id' => $obj->id), 'StatusList'); ?> </td> <td class="nav-column"> <ul class="table-controls"> <li> <a class="bs-tooltip dropdownToggle" href="javascript:void(0);" title="Управление"><i class="fa-cog size14"></i></a> <ul class="dropdownMenu pull-right"> <li> <a title="Generate and send new log in information" href="/backend/<?php echo Core\Route::controller(); ?> /send/<?php echo $obj->id; ?> "><i class="fa-envelope"></i> Generate and send...</a>
/** * Can we add a variable? * * @access public */ public function testAddVariableToView() { $view = new Core\View(); $view->addVariable('foo', 'bar'); $this->assertEquals('bar', $view->getVariable('foo')); }
public function initialize() { parent::initialize(); $this->view = view('layout/index.php'); \Core\View::$title = '文和友老长沙外卖'; }
echo $obj->name; ?> </a> <?php echo Core\View::tpl(array('result' => $pages, 'cur' => $obj->id, 'add' => ''), 'Sitemap/Recursive'); ?> </li> <?php } ?> <li><a href="<?php echo Core\HTML::link('catalog'); ?> ">Каталог</a> <?php echo Core\View::tpl(array('result' => $groups, 'cur' => 0, 'add' => '/catalog'), 'Sitemap/Recursive'); ?> </li> <li><a href="<?php echo Core\HTML::link('new'); ?> /new">Новинки</a></li> <li><a href="<?php echo Core\HTML::link('popular'); ?> /popular">Популярные</a></li> <li><a href="<?php echo Core\HTML::link('sale'); ?> /sale">Акции</a></li> <li><a href="<?php
echo \Core\Route::controller(); ?> /delete/<?php echo $obj->id; ?> " title="Удалить"><i class="fa-trash-o text-danger"></i> Удалить</a> </li> <?php } ?> </ul> </li> </ul> </td> </tr> </table> </div> <?php echo Core\View::tpl(array('result' => $result, 'tpl_folder' => $tpl_folder, 'cur' => $obj->id), $tpl_folder . '/Menu'); ?> </li> <?php } ?> <?php if ($cur > 0) { ?> </ol> <?php } }
<div class="rowSection"> <div class="col-md-12"> <div class="widget"> <div class="widgetContent"> <?php echo Core\View::tpl(array('creators' => $creators, 'events' => $events), 'Cassier/Filter'); ?> <?php if (Core\User::info()->role_id == 2 or Core\User::info()->see_all_cashier_stat == 1) { ?> <div class="rowSection"> <!-- Total orders count--> <div class="col-md-6"> <div class="widget box"> <div class="widgetHeader"> <div class="widgetTitle"> <i class="fa-reorder"></i> Заказы всех менеджеров </div> </div> <div class="widgetContent"> <div id="totalOrders" data-json='<?php echo $jsonOrders; ?> '></div> </div> </div> </div> <!-- Total prices --> <div class="col-md-6">