本文整理汇总了PHP中view::apply方法的典型用法代码示例。如果您正苦于以下问题:PHP view::apply方法的具体用法?PHP view::apply怎么用?PHP view::apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::apply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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");
}
示例2: 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");
}
示例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'] . '}');
}
示例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");
}
示例5: 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");
}
示例6: 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");
}
示例7: 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");
}
示例8: index
function index()
{
if (input::getInput("post.site")) {
$htmlStr = $this->getHtmlStr(input::getInput("post.site"));
file_put_contents(APPPATH . "config/Config.config.php", "<?php\r\n" . 'config::set(' . $htmlStr . ");\r\n?>");
$this->page_debug(lang::get('Has been save!'), getFromUrl());
}
view::apply("inc_body", "admin/configure/index");
view::display("admin/page");
}
示例9: 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");
}
示例10: 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");
}
示例11: 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");
}
示例12: 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");
}
示例13: group_edit
function group_edit()
{
$user_group = sf::getModel("user_groups", input::getInput("get.id") ? input::getInput("get.id") : input::getInput("post.id"));
if (input::getInput("post.user_group_name")) {
$user_group->setUserGroupName(input::getInput("post.user_group_name"));
if ($user_group->save()) {
$this->page_debug(lang::get("Has been saved!"), getFromUrl(site_url("home/left"), site_url("admin/user/group_list")));
}
}
$data['group'] = $user_group;
view::set($data);
view::apply("inc_body", "admin/user/group_edit");
view::display("admin/page");
}
示例14: edit
/**
* 数据编辑
*/
function edit()
{
$Authorizations = sf::getModel("Authorizations", input::getInput("post.id") ? input::getInput("post.id") : input::getInput("get.id"));
if (input::getInput("post.controller_name")) {
$Authorizations->setController(input::getInput("post.controller"));
$Authorizations->setControllerName(input::getInput("post.controller_name"));
$Authorizations->setMethod(input::getInput("post.method"));
$Authorizations->setUserGroupIds(input::getInput("post.actions"));
$Authorizations->save();
$this->page_debug(lang::get("Has been saved!"), getFromUrl(site_url("home/left"), site_url("Authorization/index")));
}
$data["authorization"] = $Authorizations;
$data['pager'] = sf::getModel("user_groups")->selectAll("", "ORDER BY id ASC", 0);
view::set($data);
view::apply("inc_body", "admin/authorization/edit");
view::display("admin/page");
}
示例15: password
function password()
{
$user = sf::getModel("users", input::getInput("session.userid"));
if (input::getInput("post.password")) {
if ($user->check(input::getInput("post.oldpassword"))) {
$user->setUserPassword(input::getInput("post.password"));
$user->setUpdatedAt(date("Y-m-d H:i:s"));
$user->save();
$this->page_debug(lang::get("Has been changed!"), site_url("login/index"));
} else {
$msg = lang::get("Password is error!");
}
}
view::set("msg", $msg);
view::set("user", $user);
view::apply("inc_body", "template/user_password");
view::display("template/page");
}