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


PHP view::set方法代码示例

本文整理汇总了PHP中view::set方法的典型用法代码示例。如果您正苦于以下问题:PHP view::set方法的具体用法?PHP view::set怎么用?PHP view::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在view的用法示例。


在下文中一共展示了view::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 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");
 }
开发者ID:kulebri,项目名称:trouble,代码行数:13,代码来源:index.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: article

 /**
  * 生成文章页面
  */
 function article()
 {
     //读取总数
     if (!$_SESSION['article']['total']) {
         $_SESSION['article']['total'] = (int) sf::getModel("articles")->getTotal("`is_html` = 0");
         $_SESSION['article']['num'] = 0;
     }
     //生成静态页面
     if ($_SESSION['article']['total'] == 0 || $_SESSION['article']['num'] >= $_SESSION['article']['total']) {
         $_SESSION['article']['num'] = 0;
         $_SESSION['article']['total'] = 0;
         exit('{total:1,num:1}');
     }
     $result = sf::getModel("articles")->selectAll("is_html = 0", '', 1);
     while ($article = $result->getObject()) {
         view::set("article", $article);
         view::apply("inc_body", "template/article_show");
         $htmlStr = view::parse("template/page");
         $path = WEBROOT . "/html/" . $article->getTypeStr();
         if (!is_dir($path)) {
             sf::getLib("Files")->mDir($path);
             exit('{total:' . $_SESSION['article']['total'] . ',num:0}');
         }
         sf::getLib("Files")->write($path . "/article-show-" . $article->getId() . ".html", $htmlStr);
         $article->setIsHtml(1);
         $article->save();
         $_SESSION['article']['num']++;
     }
     exit('{total:' . $_SESSION['article']['total'] . ',num:' . $_SESSION['article']['num'] . '}');
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:33,代码来源:Build.php

示例4: show

 /**
  * 查看模板
  */
 function show()
 {
     $template = sf::getModel("templates", input::getInput("get.id"));
     view::set("template", $template);
     view::apply("inc_body", "admin/template/show");
     view::display("admin/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:10,代码来源:Template.php

示例5: send

 /**
  * 发送简历
  */
 function send()
 {
     if (input::getInput("post")) {
         $back = sf::getModel("backs");
         $back->setSubject(input::getInput("post.subject"));
         $back->setUserName(input::getInput("post.user_name"));
         $back->setUserSex(input::getInput("post.user_sex"));
         $back->setUserAge(input::getInput("post.user_age"));
         $back->setUserDegree(input::getInput("post.user_degree"));
         $back->setIdcard(input::getInput("post.idcard"));
         $back->setUserPhone(input::getInput("post.user_phone"));
         $back->setUserIm(input::getInput("post.user_im"));
         $back->setUserEmail(input::getInput("post.user_email"));
         $back->setUserAddress(input::getInput("post.user_address"));
         $back->setPostCode(input::getInput("post.post_code"));
         $back->setWorkAt(input::getInput("post.work_at"));
         $back->setStudyList(input::getInput("post.study_list"));
         $back->setWorkList(input::getInput("post.work_list"));
         $back->setUpdatedAt(date("Y-m-d H:i:s"));
         $back->save();
         $this->page_debug(lang::get("Has been saved!"), site_url("job/index"));
     }
     view::set("job", sf::getModel("jobs", input::getInput("get.id")));
     view::apply("inc_body", "template/job_send");
     view::display("template/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:29,代码来源:Job.php

示例6: main

 function main()
 {
     $data['user'] = sf::getModel("managers", input::getInput("session.userid"));
     view::set($data);
     view::apply("inc_body", "admin/main");
     view::display("admin/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:7,代码来源:Home.php

示例7: index

 public function index($args)
 {
     $db = $this->database();
     $articles = array();
     $sth = $db->prepare("\n\t\t\tSELECT\t\tid, title, body, date_added, author, publisher, date\n\t\t\tFROM\t\tarticles\n\t\t\tORDER BY\tdate_added DESC\n\t\t\tLIMIT\t\t5\n\t\t");
     $sth->execute();
     while ($article = $sth->fetch()) {
         $seo_url = new seo_url($article);
         $s = new markdown_smartypantstypographer();
         $articles[] = array("id" => $article["id"], "title" => $article["title"], "excerpt" => $s->transform(utf8_encode(substr($article["body"], 0, 200))) . "…", "seo_url" => $seo_url->url, "date_added" => date("dS M", strtotime($article["date_added"])), "author" => $article["author"], "publisher" => $article["publisher"], "date" => $article["date"]);
     }
     $tpl = new view($this->registry);
     $tpl->set("articles", $articles);
     $tpl->set("page_title", "Look At That F***ing Title");
     $tpl->set("subview", "home_body");
     $tpl->show("home");
 }
开发者ID:Huggie,项目名称:hci1,代码行数:17,代码来源:index.php

示例8: index

 function index()
 {
     $page = sf::getModel("pages")->showPage($this->type, input::getInput("get.id"));
     config::set('title', $page->getSubject());
     view::set("page", $page);
     view::apply("inc_body", "template/about_us");
     view::display("template/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:8,代码来源:Page.php

示例9: view

 public function view($args)
 {
     $template = new view($this->registry);
     $db = $this->database();
     $sth = $db->prepare("\n\t\t\tSELECT \tid, title, body, author, date, publisher\n\t\t\tFROM \tarticles\n\t\t\tWHERE\tid = :id\n\t\t\tLIMIT \t1\n\t\t");
     $sth->execute(array(":id" => $args["id"]));
     $article = $sth->fetch();
     $template->set("page_title", "Look At That F***ing Title");
     $template->set("title", utf8_encode($article["title"]));
     $p = new markdown_parser();
     $s = new markdown_smartypantstypographer();
     include SITE_PATH . DIRSEP . "definitions" . DIRSEP . "article.php";
     $body_text = $p->transform($s->transform($article["body"]));
     $article_info = sprintf(HTML_ARTICLE_INFO, $article["author"], $article["date"], $article["publisher"]);
     $template->set("info", $article_info);
     $template->set("body", utf8_encode(sprintf(HTML_ARTICLE_BODY, $body_text)));
     $template->show("home");
 }
开发者ID:radiosilence,项目名称:kt-equal,代码行数:18,代码来源:article.php

示例10: show

 /**
  * 查看新闻
  */
 function show()
 {
     $article = sf::getModel("articles", input::getInput("get.id"));
     //设置页面title
     config::set('title', $article->getSubject());
     view::set("article", $article);
     view::apply("inc_body", "template/article_show");
     view::display("template/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:12,代码来源:Article.php

示例11: show

 /**
  * 查看产品
  */
 function show()
 {
     $product = sf::getModel("products", input::getInput("get.id"));
     //设置页面title
     config::set('title', $product->getSubject());
     view::set("product", $product);
     view::apply("inc_body", "template/product_show");
     view::display("template/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:12,代码来源:Product.php

示例12: index

 function index()
 {
     $addWhere = $addSql = '';
     $addSql = "order by updated_at DESC";
     $addWhere .= " is_public = 1 ";
     input::getInput("post.search") && ($addWhere .= " AND `content` LIKE '%" . trim(input::getInput("post.search")) . "%' ");
     //取得带翻页的数据集
     $from_vars = array('field', 'search', 'type');
     view::set("pager", sf::getModel("books")->getPager($addWhere, $addSql, 5, '', '', $from_vars));
     view::apply("inc_body", "template/book");
     view::display("template/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:12,代码来源:Book.php

示例13: edit_back

 function edit_back()
 {
     $back = sf::getModel("backs", input::getInput("post.id") ? input::getInput("post.id") : input::getInput("get.id"));
     if (input::getInput("post.note")) {
         $back->setNote(input::getInput("post.note"));
         $back->save();
         $this->page_debug(lang::get("Has been saved!"), site_url("admin/job/back"));
     }
     view::set("back", $back);
     view::apply("inc_body", "admin/job/edit_back");
     view::display("admin/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:12,代码来源:Job.php

示例14: edit

 /**
  * 数据编辑
  */
 function edit()
 {
     $orders = sf::getModel("Order_froms", input::getInput("post.id") ? input::getInput("post.id") : input::getInput("get.id"));
     if (input::getInput("post.note")) {
         $orders->setNote(input::getInput("post.note"));
         $orders->setIsPublic(input::getInput("post.is_public"));
         $orders->save();
         $this->page_debug(lang::get("Has been saved!"), site_url("admin/orders/index"));
     }
     view::set("orders", $orders);
     view::apply("inc_body", "admin/order/edit");
     view::display("admin/page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:16,代码来源:Orders.php

示例15: edit

 /**
  * 数据编辑
  */
 function edit()
 {
     $filemanager = sf::getModel("filemanager", input::getInput("post.id") ? input::getInput("post.id") : input::getInput("get.id"));
     if (input::getInput("post.file_note")) {
         input::getInput("post.file_note") && $filemanager->setFileNote(input::getInput("post.file_note"));
         input::getInput("post.file_name") && $filemanager->setFileName(input::getInput("post.file_name"));
         $filemanager->save();
         $this->page_debug(lang::get("Has been saved!"), getFromUrl());
     }
     view::set("filemanager", $filemanager);
     view::apply("inc_body", "filemanager/edit");
     view::display("page");
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:16,代码来源:Files.php


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