/** * @return \Twig_Environment */ public function setEnvironment() { $this->methods['twigLoader'] = new \Twig_Loader_Filesystem($this->view->getTemplateLocation()); $this->twig = new \Twig_Environment($this->methods['twigLoader'], array('cache' => CYGNITE_BASE . DS . 'public' . DS . 'storage' . DS . 'temp' . DS . 'twig' . DS . 'tmp' . DS . 'cache', 'auto_reload' => $this->methods['getAutoReload'], 'debug' => $this->methods['isDebugModeOn'])); $this->setDefaultFunctions(); return $this->twig; }
public function index($args) { $db = $this->database(); $s = new model_section($db); $p = new model_page($db); $md = new markdown_parser(); $rt = explode("/", $args["_url"]); $s->load_from_name(strlen($rt[0]) > 0 ? $rt[0] : "home"); array_shift($rt); $rt = implode("/", $rt); $cur_url = strlen($rt) > 0 ? $args["_url"] : $s->default_page(); $p->load_from_url($cur_url); $navs = MODEL_SECTION::get_sections($db); $subnavs = $s->get_pages(); $tpl = new view($this->registry); $tpl->set("cur_url", $cur_url); $tpl->set("title", $p->title); $tpl->set("navs", $navs); $tpl->set("subnavs", $subnavs); $tpl->set("page", $s->name); $tpl->set("content", $p->is_markdown ? array("markdown" => $md->transform($p->content)) : array("html" => $p->content)); $tpl->set("s_intro", $md->transform($s->introduction)); $tpl->set("s_img", $s->image); $tpl->show("default"); }
/** * Return Tools-Page as HTML-View (only Logout) */ public function getTools() { require 'classes/view.php'; $view = new view(); $view->setTemplate('admin/tools'); return $view->loadTemplate(new stdClass()); }
/** * Sets up the layout HTML that goes around the selected tool * @param view $view * @param \view\DateTimeView $dtv */ public function render($view, DateTimeView $dtv) { ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Study Tools</title> </head> <body> <h1>Final Project</h1> <?php echo '<a href="?">Home | </a>'; echo '<a href="?calculator"> Calculator | </a>'; echo '<a href="?converter"> Unit Converter | </a>'; echo '<a href="?periodictable"> Periodic Table</a>'; ?> <div class="container" > <?php echo $view->doView(); $dtv->show(); ?> </div> </body> </html> <?php }
public function indexAction($args) { $v = new view("dashboard"); $v->assign("mesargs", $args); if (!isset($_SESSION['role']) || $_SESSION['role'] != "admin") { $this->redirect("index", ""); } }
/** * Return Highscore-Page as HTML-View */ public function getMain() { require_once 'classes/person.php'; require_once 'classes/view.php'; person::startSession(); $view = new view(); return $view->loadTemplate($this->getModel()); }
public function actionOne() { $id = $_GET['id']; $item = News::getOne($id); $view = new view(); $view->item = $item; $view->display('news/one.php'); }
public function outputHowTo($i_howtoID) { $objThis_M = new data(); $s_sql = "select\r\n\t\t\t D.howtoName,\r\n\t\t\t C.chapterID, \r\n\t\t\t C.chapterName, \r\n\t\t\t C.displayOrder,\r\n\t\t\t H.headingID,\r\n\t\t\t H.displayOrder,\r\n\t\t\t H.headingName,\r\n\t\t\t T.contentID,\r\n\t\t\t T.contentTitle,\r\n\t\t\t T.displayOrder,\r\n\t\t\t T.howtoContent\r\n\t\t\tfrom cms.dyn_howto_document D\r\n\t\t\tinner join cms.dyn_howto_content T\r\n\t\t\t on D.howtoID = T.howtoID\r\n\t\t\tleft join cms.cfg_howto_headings H\r\n\t\t\t on T.headingID = H.headingID \r\n\t\t\tinner join cms.cfg_howto_chapters C\r\n\t\t\t on T.chapterID = C.chapterID \r\n\t\t\twhere D.howtoID = {$i_howtoID} \r\n\t\t\torder by\r\n\t\t\t C.displayOrder,\r\n\t\t\t H.displayOrder,\r\n\t\t\t T.displayOrder,\r\n\t\t\t T.howtoContent;"; $q_getData = $objThis_M->runSQL($s_sql); $objThis_V = new view(); $s_main = $objThis_V->outputHowTo($q_getData); return $s_main; }
static function show($msg, $title = '操作失败', $cacheId = 'null', $cacheTime = -1) { $error = new view(); $error->template_dir = _FFPHP_ . 'extend'; $error->assign('title', $title); $error->assign('msg', $msg); $error->display('template/error'); exit; }
function complement_user_profile($user) { include_once "model.php"; include_once "view.php"; $model = new model(); $view = new view(); $result = $model->get_agencies(); $view->profile_fields($user, $result); }
/** * Returns Login-Page as HTML-View * @param unknown_type $succesLocation */ public function getMain($succesLocation = '') { require 'classes/view.php'; $view = new view(); $view->setTemplate('login'); $model = new stdClass(); $model->submitUrl = 'Admin'; return $view->loadTemplate($model); }
protected final function fetch($templateFile = CONTROLLER_NAME) { if (!is_file($templateFile)) { $templateFile = $this->addon_path . $templateFile . C('TMPL_TEMPLATE_SUFFIX'); if (!is_file($templateFile)) { throw new \Exception("模板不存在:{$templateFile}"); } } return $this->view->fetch($templateFile); }
public function render($filename, $parameters, $uri = null) { if ($uri === null) { $uri = $this->_uri; } $view = new view(); $view->setFilename(dirname($this->_filename) . '/' . $filename); $view->setUri($uri); $view->show($parameters); }
public function indexAction($args) { if ($this->getActiveContest() == FALSE) { $v = new view("nocontest"); $v->assign("mesargs", $args); } else { $v = new view("index"); $v->assign("mesargs", $args); } }
function set($route) { $page = isset($_GET["page"]) ? $_GET["page"] : "index"; if (array_key_exists($page, $route)) { $route_path = root_directory . $route[$page]; } else { // If there is no route specified, send to 404 (no page found) page. $route_path = root_directory . blastpad_module_path . "/blastpad_cms/master/site/404.php"; } $view = new view(); echo $view->render($route_path); }
/** * Return Kategorien-Page as HTML-View */ public function getMain() { require 'classes/SQL.php'; require 'classes/view.php'; $model = new stdClass(); $model->template = 'admin/KategorieTable'; $sql = new SQL(); $sql->connect(); $model->data = $sql->get("SELECT * FROM quizCategories"); $view = new view(); return $view->loadTemplate($model); }
protected function _view($filename, $parameters = array(), $uri = null) { if ($uri === null) { $uri = $this->rel(); } $view = new view(); //echo $filename; $view->setFilename($filename); $view->setUri($uri); $view->show($parameters); //include($filename); }
public function index($args) { $view = new view(); $db = $this->database(); $this->load_locale("lang"); $g = new model_game($db); // $g->assign_targets(); $g->kill_agent("Edward"); $view->set("games", MODEL_KILL::killboard_list()); $view->set("page_title", L_PAGE_TITLE); $view->set("site_name", L_SITE_NAME); $view->show("home"); }
/** * Return QuestionTable-Page as HTML-View * parameters = POST: CategorieID */ public function getQuestionTable() { require 'classes/SQL.php'; require 'classes/view.php'; $categorie = htmlentities($_POST['katID']); $model = new stdClass(); $model->template = 'admin/QuestionTable'; $sql = new SQL(); $sql->connect(); $model->data = $sql->get("SELECT * FROM ViewQuestionQuote WHERE categorie='" . $categorie . "' ORDER BY question"); $view = new view(); return $view->loadTemplate($model); }
/** * Generate the view linked to the current controller */ protected function ctrlGenerateView($dataView = array(), $action = null) { $viewAction = $this->ctrlAction; if ($action != null) { $viewAction = $action; } // Determination of the filename of the view from current controller name $ctrlClassName = get_class($this); $viewName = str_replace("Controller", "", $ctrlClassName); // Instanciation and creation of the view $view = new view($viewAction, $viewName); $view->generate($dataView); }
public function active_top_html() { /** 获取证书,企业号的验证 **/ $active_url = url::route('shopadmin', ['app' => 'entermembercenter', 'ctl' => 'register']); $pagedata['active_url'] = $active_url; return view::make('entermembercenter/desktop_active_top.html', $pagedata)->render(); }
public function edit($id) { //$modul=Submodule::getModuleNotIn($id)->get(); $modul = Submodule::getModule($id)->get(); $allmodul = Module::getAllModule(); return view::make('usermanagement::roles.editRoles', compact('modul', 'allmodul', 'id')); }
function LoadTemplate($template, $dataArr) { if (file_exists(TEMPLATE . DS . $template)) { Validate_Auth::start(); $view = new view($template); if (!empty($dataArr)) { $view->render($dataArr); } else { $tempArr = array('NO' => 'DATA'); $view->render($tempArr); } } else { echo 'Error!!! el template al que deseas accesar no existe. '; echo $template; } }
function CoreBase() { global $i18n; $view =& view::instance(); $this->db =& $view->db; $this->i18n =& $i18n; }
/** * Constructor */ function xml_feed() { $this->view =& view::instance(); $this->db_conf =& new db_config(); $this->rewrite = $this->db_conf->get_config('mod_rewrite'); $this->http_root = get_httproot(); }
public function __construct($l, $c, $d = null) { parent::__construct($l, $c, $d); $dop = file_get_contents('tpl/part_categ.tpl'); $this->content = preg_replace("/{CATEGORY}/Ui", $dop, $this->content); $this->content = preg_replace("/{CAT_ITEM}/Ui", $d['category'], $this->content); }
public function index() { /** 登录之前的预先验证 **/ if (!defined("STRESS_TESTING")) { $obj_services = kernel::servicelist('app_pre_auth_use'); foreach ($obj_services as $obj) { if (method_exists($obj, 'pre_auth_uses') && method_exists($obj, 'login_verify')) { $pagedata['desktop_login_verify'] = $obj->login_verify(); } } } /** end **/ //检查证书是否合法,从而判定产品功能是否可用。比如b2c功能 $certCheckObj = kernel::service("product_soft_certcheck"); if (is_object($certCheckObj) && method_exists($certCheckObj, "check")) { $certCheckObj->check(); } $pagedata['desktop'] = url::route('shopadmin'); $pagedata['redirect'] = input::get('url'); $pagedata['Commerce'] = 'yes'; $pagedata['img_url'] = app::get('desktop')->res_url . '/images/login.png'; if (pamAccount::isEnableVcode('desktop')) { $pagedata['show_varycode'] = 'true'; } $pagedata['error_info'] = urldecode(input::get('msg')); $conf = base_setup_config::deploy_info(); $pagedata['product_key'] = $conf['product_key']; return view::make('desktop/login.html', $pagedata); }
function main() { $pagedata['data'] = $this->getViews(); /** 判断是否要显示归类视图 **/ $pagedata['haspacket'] = $pagedata['data'] ? true : false; return view::make('desktop/finder/view/packet.html', $pagedata)->render(); }
public function create() { $city = City::all(); $type = VehicleType::all(); $partner = Partner::all(); return view::make('vehicle::addVehicle', compact('city', 'type', 'partner')); }
public function get_single(Request $request, $id) { $view = view::make("project"); $view->projects = Project::all(); $view->active_project = Project::find($id); return $view; }