本文整理汇总了PHP中view类的典型用法代码示例。如果您正苦于以下问题:PHP view类的具体用法?PHP view怎么用?PHP view使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了view类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setEnvironment
/**
* @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;
}
示例2: index
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");
}
示例3: getTools
/**
* 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());
}
示例4: render
/**
* 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
}
示例5: indexAction
public function indexAction($args)
{
$v = new view("dashboard");
$v->assign("mesargs", $args);
if (!isset($_SESSION['role']) || $_SESSION['role'] != "admin") {
$this->redirect("index", "");
}
}
示例6: getMain
/**
* 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());
}
示例7: actionOne
public function actionOne()
{
$id = $_GET['id'];
$item = News::getOne($id);
$view = new view();
$view->item = $item;
$view->display('news/one.php');
}
示例8: outputHowTo
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;
}
示例9: show
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;
}
示例10: complement_user_profile
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);
}
示例11: getMain
/**
* 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);
}
示例12: fetch
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);
}
示例13: render
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);
}
示例14: indexAction
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);
}
}
示例15: set
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);
}