当前位置: 首页>>代码示例>>PHP>>正文


PHP view类代码示例

本文整理汇总了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;
 }
开发者ID:jhonbendar,项目名称:framework,代码行数:10,代码来源:Template.php

示例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");
 }
开发者ID:radiosilence,项目名称:kt-equal,代码行数:25,代码来源:index.php

示例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());
 }
开发者ID:roderm,项目名称:mkn151,代码行数:10,代码来源:Admin.php

示例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 
 }
开发者ID:pyrotecnick,项目名称:FinalProject,代码行数:32,代码来源:LayoutView.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", "");
     }
 }
开发者ID:phjeannine,项目名称:hakoopix,代码行数:8,代码来源:dashboardController.class.php

示例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());
 }
开发者ID:roderm,项目名称:mkn151,代码行数:11,代码来源:Highscore.php

示例7: actionOne

 public function actionOne()
 {
     $id = $_GET['id'];
     $item = News::getOne($id);
     $view = new view();
     $view->item = $item;
     $view->display('news/one.php');
 }
开发者ID:seclace,项目名称:news,代码行数:8,代码来源:newsController.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;
 }
开发者ID:braddoro,项目名称:braddoro,代码行数:9,代码来源:howto_c.php

示例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;
 }
开发者ID:laiello,项目名称:ffphp,代码行数:9,代码来源:debug.class.php

示例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);
}
开发者ID:rdelr011,项目名称:BOLO-Flier-Creator,代码行数:9,代码来源:extra-user-data.php

示例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);
 }
开发者ID:roderm,项目名称:mkn151,代码行数:13,代码来源:Login.php

示例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);
 }
开发者ID:zhendeguoke1008,项目名称:OneShop,代码行数:10,代码来源:Addon.class.php

示例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);
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:10,代码来源:view.php

示例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);
     }
 }
开发者ID:phjeannine,项目名称:hakoopix,代码行数:10,代码来源:indexController.class.php

示例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);
 }
开发者ID:hscale,项目名称:BlastPad,代码行数:12,代码来源:routing_class.php


注:本文中的view类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。