public function actionOne() { $id = isset($_GET['id']) ? $_GET['id'] : 1; $view = new View(); $page = new PageController(); $view->assign('item', News::getOne($id)); $view->assign('links', $page->createLink($this->ctrl)); $view->display($this->view_one); }
/** * Messages Example * @return null */ public function messageAction() { $View = new View('examples/message'); $View->assign('_title_', _('Message Examples')); $View->assign('_message_', "Ejemplo de como abrir un mensaje desde el controlador"); $View->display(); }
/** * multiple page thingy * @return null */ public function multipageAction() { $Request = Request::getInstance(); $template = $Request->template; $pages = array('intro' => 'Introducción', 'mvc' => 'Model View Controller', 'layer' => 'Good Cake, Bad Cake', 'diagram_simplified' => 'Diagrama', 'diagram' => 'Diagrama Extendido', 'credits' => 'Creditos'); $links = '<p>'; foreach ($pages as $page => $name) { $links .= "<a href=\"" . BASE_URL . "/index/multipage/?template={$page}\">{$name}</a> "; } $links .= "</p>"; $View = new View("index/{$template}"); $View->assign('_title_', $pages[$template]); $View->assign('links', $links); $View->display(); }
function index() { $chart_pie = $chart_line = null; //love easy $this->load_library("Charts"); $data = array(array('OSX', 10), array('Win', 3), array('Unix', 7)); $this->Charts->set_data($data); //$chart_pie = $this->Charts->draw_pie(); $this->Charts->load_csv(WEBSITE_DIR . "assign_execution_time.csv"); $chart_line = $this->Charts->draw_line(); $tpl = new View(); $tpl->assign("chart_pie", $chart_pie); $tpl->assign("chart_line", $chart_line); $tpl->draw("charts/charts"); }
public function display() { $view = new View(); $view->setTemplate('header'); $view->assign('title', 'openmuseum'); return $view->loadTemplate(); }
/** * hook: module_output_bottom * Show comments and comments form * * @param array $msc * @param int $contentType * @param string $sector * @param string $title * @return mixed */ public function hookModuleOutputBottom(array $mcs, $contentType, $sector, $title) { if ($sector == 'SC' && $contentType & Zula_ControllerBase::_OT_CONTENT_DYNAMIC && !($contentType & Zula_ControllerBase::_OT_CONFIG)) { $requestPath = $this->_router->getRequestPath(Router::_TRIM_ALL); $view = new View('display/linear.html', 'comments'); $view->assign(array('TITLE' => $title)); $view->assignHtml(array('COMMENTS' => $this->_model('comments', 'comments')->get($requestPath))); if ($this->_acl->check('comments_post')) { /** * Store the hash path as a valid comment path, then build the * form view and output both views */ $hashPath = zula_hash($requestPath); $_SESSION['mod']['comments'][$hashPath] = array('path' => $requestPath, 'siteType' => $this->_router->getSiteType()); $form = new View('form.html', 'comments'); $form->assign(array('comments' => array('hash' => $hashPath, 'name' => $this->_session->getUser('username'), 'website' => null, 'body' => null))); // Antispam/Captcha $antispam = new Antispam(); $form->assignHtml(array('CSRF' => $this->_input->createToken(true), 'ANTISPAM' => $antispam->create())); return $view->getOutput() . $form->getOutput(); } else { return $view->getOutput(); } } }
/** * indexAction * * Index action of main controller forum module * * @return null */ public function indexAction() { // assign data into view \View::assign(array('title' => \View::$language->forum_main_title, 'h1' => \View::$language->forum_main_title, 'forumsTree' => helpers\ForumsTreeHelper::getTree())); // set output layout \View::setLayout('forum-main.phtml'); }
/** * 首页 *+---------------------------- * http://yourdomain/index.php/ */ public function action_index() { //实例化一个视图对象 $view = new View('index.php'); $view->assign('title', 'hello world')->render(); //绑定变量并渲染视图 }
public static function Index(View $page) { $dir = $page->getParameter('directory'); if (!$dir) { $page->error = View::ERROR_BADREQUEST; return; } ////// Security checks... // Usage of '..' is explicitly denied, as it can escape the filesystem. if (strpos($dir, '../') !== false) { $page->error = View::ERROR_BADREQUEST; return; } // Directory must contain at least one directory in. // And it also must start with public/ if (!preg_match('/^public\/[a-z0-9]+/', $dir)) { $page->error = View::ERROR_BADREQUEST; return; } // Now I can finally start the actual logic. $d = Core::Directory($dir); if (!$d->isReadable()) { $page->error = View::ERROR_NOTFOUND; return; } $page->assign('files', $d->ls()); }
/** * Assign a variable to the template. * * @param string|array $tpl_var * @param mixed $value * @return \Smarty_Internal_Data */ public function assign($tpl_var, $value) { if ($tpl_var != 'modules') { $this->addToDebug($tpl_var, $value, 'assigns'); } return $this->view->assign($tpl_var, $value); }
public function display() { $view = new View(); $view->setTemplate('navBar'); $view->assign('active', $this->active); return $view->loadTemplate(); }
public function main() { //Create a new view and pass it our template $view = new View(strtolower($this->viewfile)); //Assign Page Variable $view->assign('var1', 'About page variable.'); }
/** * CSSの読み込みタグを出力する */ public function testCss() { // ノーマル ob_start(); $this->BcBaser->css('admin/import'); $result = ob_get_clean(); $expected = '<link rel="stylesheet" type="text/css" href="/css/admin/import.css" />'; $this->assertEqual($result, $expected); // 拡張子あり ob_start(); $this->BcBaser->css('admin/import.css'); $result = ob_get_clean(); $expected = '<link rel="stylesheet" type="text/css" href="/css/admin/import.css" />'; $this->assertEqual($result, $expected); // インラインオフ(array) $this->BcBaser->css('admin/import.css', array('inline' => false)); $expected = '<link rel="stylesheet" type="text/css" href="/css/admin/import.css" />'; $result = $this->_View->Blocks->get('css'); $this->assertEqual($result, $expected); $this->_View->Blocks->end(); // インラインオフ(boolean) $this->BcBaser->css('admin/import.css', false); $expected = '<link rel="stylesheet" type="text/css" href="/css/admin/import.css" />'; $this->_View->assign('css', ''); $this->assertEqual($result, $expected); }
/** * indexAction * * Index action of main controller documentation module * * @return null */ public function indexAction() { // TODO PHP.SU introduction of this PHP documentation mirror // assign data into view \View::assign(array('title' => \View::$language->documentation_main_title, 'h1' => \View::$language->documentation_main_title, 'content' => '<p>Something here...</p>')); // set output layout \View::setLayout('documentation.phtml'); }
public function actionOne() { $id = $_GET['id']; $item = News::getOne($id); $view = new View(); $view->assign('item', $item); $view->display('news/one.php'); }
public function testCallMethodOnView() { View::useLib('Mock'); $view = new View(); $view->assign('chuck', 'norris'); $this->assertEqual(1, count(MockView::$var)); $this->assertEqual('norris', MockView::$var['chuck']); }
/** * Methode zum anzeigen des Contents. * * @return String Content der Applikation. */ public function display() { $view = new View(); switch ($this->template) { case 'createTables': $view->setTemplate('createTables'); $oApi = new api(); $aResult = $oApi->createDatabase(); $view->assign('state', $aResult); break; case 'config': $view->setTemplate('config'); if (!empty($this->sleep)) { Model::setConfigSleepData($this->sleep); } $aConfigData = Model::getConfigSleepData(); $view->assign('config', $aConfigData); break; case 'report': $view->setTemplate('report'); $view->assign('state', $this->state); $aReportData = Model::getReportData(); $view->assign('data', $aReportData); if (!empty($this->request['a'])) { switch ($this->request['a']) { case 1: break; case 2: $view->assign('users', Model::getUser()); if ($this->user) { $view->assign('reportDataByUser', Model::getReportDataByParams('reportUsers', $this->user)); } else { $view->assign('reportDataByUser', Model::getReportDataByParams('reportUsers', '%%')); } break; case 3: $view->assign('reportDataApps', Model::getReportDataByApps()); break; case 4: $view->assign('reportDataMac', Model::getReportDataByParams('reportMac', '%%')); break; default: } } break; default: $view->setTemplate('start'); } return $view->loadTemplate(); }
public function actionOne() { $id = isset($_GET['id']) ? (int) $_GET['id'] : null; $item = News::findOne($id); $view = new View(); $view->assign('item', $item); $template = 'news/news_one_view.php'; $view->display($template); }
public function newAction() { if ($User = UserModel::getLoggedInUser()) { $this->gotoPage('/index', 'You can\'t register being logged in'); } $View = new View('user/new'); $View->assign('_title_', _('New User')); $View->display(); }
public function actionGetOne() { $RecId = isset($_GET['id']) ? (int) $_GET['id'] : null; $Item = News::getOne($RecId); $ViewObj = new View(); $ViewObj->assign('item', $Item); $template = 'news/news_one_view.php'; $ViewObj->display($template); }
public function actionOne() { $id = isset($_GET['id']) ? $_GET['id'] : null; $item = News::getOneRec($id); $file = __DIR__ . '/../views/news/news_one_view.php'; $view = new View($item); $view->assign('item', $file); $view->display(); }
static function relyFile() { $styles_arr = array('core.Bracket.style#default', 'core.Bracket.bootstrap#min', 'core.Bracket.bootstrap-override', 'core.Bracket.weather-icons#min', 'core.Bracket.animate#delay', 'core.Bracket.select2', 'core.Bracket.toggles', 'core.Bracket.animate#min', 'core.Bracket.lato', 'core.Bracket.roboto', 'core.Bracket.jquery-ui-1#10#3', 'core.Bracket.font-awesome#min', 'core.Bracket.search-slide'); // core.Bracket. $scripts_arr = array('core.Bracket.jquery-1#11#1#min', 'core.Bracket.jquery-migrate-1#2#1#min', 'core.Bracket.jquery-ui-1#10#3#min', 'core.Bracket.jquery#cookies', 'core.Bracket.bootstrap#min', 'core.Bracket.modernizr#min', 'core.Bracket.jquery#sparkline#min', 'core.Bracket.toggles#min', 'core.Bracket.retina#min', 'core.Bracket.custom', 'core.Bracket.search-slide', 'core.Bracket.message'); View::assign('scriptTml', '<script>jQuery(document).ready(function (){%s})</script>'); View::l_assign('styles', $styles_arr, 1); View::assign('scripts', $scripts_arr, 1); return View::layout('core.Html5.baseRelyFile'); }
function index() { //love easy $this->load_model("content", "content_obj"); $content_row = $this->content_obj->get(); // Load view $tpl = new View(); $tpl->assign($content_row); $tpl->draw('content/content'); }
static function index() { if (self::isLogin()) { Error::halt('', '', '', ''); exit('<script>alert("你已经登录,请退出后再登录");window.location.href="./Index_index.jsp";</script>'); } View::assign('scripts', array('core.Bracket.bootstrapValidator#min')); View::assign('styles', array('core.Bracket.bootstrapValidator#min')); View::display(); }
public function actionEdit() { $RecId = isset($_GET['id']) ? (int) $_GET['id'] : null; $record = News::findOne($RecId); $view = new View(); echo 'header=' . $record->NewsHeader; $view->assign('item', $record); $template = 'news/news_edit_view.php'; $view->display($template); }
/** * * 构造函数 * @param $param 实例化时传入的参数 */ public function __construct($param = array()) { $this->param = $param; //分类菜单相关 $this->adminMenuObi = new AdminMenuModel(); $this->menuList = $this->adminMenuObi->getList(); $this->menuList = Func::arrayKey($this->menuList); $this->menuListTree = Func::categoryTree($this->menuList); View::assign('menuList', $this->menuListTree); }
/** * Shows all shareable sites * * @return string */ public function indexSection() { $sites = $this->_model('shareable', 'shareable')->getSites(Shareable_Model::_ENABLED); if ($this->_dispatcher->isDispatched() && $this->_dispatcher->getStatusCode() == 200 && $sites) { $view = new View('main.html', 'shareable'); $view->assign(array('SITES' => $sites, 'TITLE' => $this->_dispatcher->getReqCntrl()->getDetail('title'), 'SECTOR' => $this->getSector())); return $view->getOutput(); } else { return $this->inSector('SC') ? '' : false; } }
function showHtmlList() { global $lll; $_S =& new AppSettings(); hasAdminRights($isAdm); if (!$isAdm) { LocationHistory::rollBack(new AppController("/")); } JavaScript::addCss(CSS_DIR . "/category.css"); $catArr = array(); $adminsettCtrl =& new AppController("settings/modify_form"); $contentManagementCtrl =& new AppController("content/modify_form"); $usersCtrl =& new AppController("user/list"); $NotificationsCtrl =& new AppController("notification/list"); $checkconfCtrl =& new AppController("checkconf/show"); $checkUpdatesCtrl =& new AppController("checkconf/updates"); $customListsCtrl =& new AppController("customlist/list"); $rssCtrl =& new AppController("rss/modify_form/1"); $purchaseItemCtrl =& new AppController("purchaseitem/sortfield_form"); $pendingPurchaseItemsCtrl =& new AppController("purchaseitem/list"); $ecommSettingsCtrl =& new AppController("ecommsettings/modify_form"); $creditRulesCtrl =& new AppController("creditrule/list"); $paymentRulesCtrl =& new AppController("paymentrule/list"); $subscription_ttitleCtrl =& new AppController("subscription/list"); $itemfield_ttitle_globalCtrl =& new AppController("field/sortfield_form/0"); $items = array("adminsett", "contentManagement", "users", "Notifications", "customLists", "itemfield_ttitle_global", "checkUpdates"); if (class_exists("rss")) { $items[] = "rss"; } if ($_S->subscriptionType) { $items[] = "subscription_ttitle"; } if ($_S->ecommerceEnabled()) { $_ES =& new ECommSettings(); $items[] = "ecommSettings"; if ($_ES->model == ecomm_advanced) { $items[] = "creditRules"; $items[] = "purchaseItem"; } else { $items[] = "paymentRules"; $items[] = "pendingPurchaseItems"; } } $i = 0; foreach ($items as $item) { $catArr[$i]->title = $lll[$item]; $catArr[$i]->description = $lll["{$item}Description"]; $catArr[$i]->link = ${$item . "Ctrl"}->makeUrl(); $catArr[$i]->picture = ""; $catArr[$i]->title = $lll[$item]; $i++; } View::assign("categories", $catArr); }
/** * indexAction * * Index action of sign in controller user module * * @return null */ public function indexAction() { // add language \View::addLanguageItem('signInController'); // append breadcrumbs \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem(null, \View::$language->sign_in_title)); // assign data into view \View::assign('title', \View::$language->sign_in_title); // set output layout \View::setLayout('user-sign-in.phtml'); }
/** * hook: module_output_bottom * Adds in the 'Share This'/Site Submission to bottom of certain * content types. * * @param array $msc * @param int $contentType * @param string $sector * @param string $title * @return mixed */ public function hookModuleOutputBottom(array $mcs, $contentType, $sector, $title) { if ($contentType & Zula_ControllerBase::_OT_CONTENT_DYNAMIC && !($contentType & Zula_ControllerBase::_OT_CONFIG)) { $sites = $this->_model('shareable', 'shareable')->getSites(Shareable_Model::_ENABLED); if ($sites) { $view = new View('main.html', 'shareable'); $view->assign(array('SITES' => $sites, 'TITLE' => $title)); return $view->getOutput(); } } }