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


PHP view::compile方法代码示例

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


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

示例1: simple

 static function simple($firstPage, $currentPage, $lastPage)
 {
     // setup registry
     $reg = new registry();
     $reg['first'] = $firstPage;
     $reg['previous'] = $currentPage <= $firstPage ? $firstPage : $currentPage - 1;
     $reg['next'] = $currentPage >= $lastPage ? $lastPage : $currentPage + 1;
     $reg['last'] = $lastPage;
     // look for project view file
     $srcView = sprintf('%s/pagerSimple.phtml', VIEW);
     // if fail, fallback to mwa version
     if (!file_exists($srcView)) {
         $srcView = sprintf('%s/view/pagerSimple.phtml', LIBRARY);
     }
     // if fallback not found, throw error.
     if (!file_exists($srcView)) {
         throw new Exception('the given file ' . $srcView . ' was not found.');
     }
     // init and exec view
     $view = new view($srcView);
     return $view->compile($reg);
 }
开发者ID:madr,项目名称:urban-octo-rotary-phone,代码行数:22,代码来源:pager.php

示例2: view

<?php

/**
 * fotoalbum.php
 * 
 * photoalbum admin page
 * @author Anders Ytterström <anders.ytterstrom@gmail.com>
 * @since 2007-12-29
 */
require '../../../init.php';
if (!isset($_POST['delete'])) {
    http_response::redir('/admin/fotoalbum');
}
$registry =& registry::getInstance();
$user =& user::getInstance();
$view = new view(ROOT . '/view/admin/photos/delete.phtml');
$model = new model_photos();
if (!$user->isOnline()) {
    http_response::redir('/login.php');
}
$registry['sidebar'] = false;
$registry['delete'] = $_POST['delete'];
echo $view->compile();
开发者ID:madr,项目名称:urban-octo-rotary-phone,代码行数:23,代码来源:radera.php

示例3: Exception

<?php

$user = user::getInstance();
$registry = registry::getInstance();
// validate model and construct if correct.
$registry['modelLabel'] = http_request::getString('model');
if ($registry['modelLabel'] == false || !file_exists(ROOT . '/model/' . $registry['modelLabel'] . ".php")) {
    throw new Exception("the model <b>" . $registry['modelLabel'] . "</b> does not exist in this application. It could have been removed, or has ever existed. Check the spelling and try again.");
}
$qryModel = "model_" . $registry['modelLabel'];
$model = new $qryModel();
// needed for the page header.
admin::getModels();
$registry['controls'] = $model->getEntityProperties();
// setup page
$registry['entities'] = $model->getSummary();
$registry['title'] = $registry['modelLabel'];
$registry['bclass'] = $registry['modelLabel'] . " list model";
//see if there is any custom template. Else,fall back on default.
$ct = sprintf("%s/view/cms/list/%s.phtml", ROOT, $registry['modelLabel']);
if (!file_exists($ct)) {
    $ct = sprintf("%s/list/%s.phtml", VIEW, $registry['modelLabel']);
}
if (file_exists($ct)) {
    $view = new view($ct);
    $view->isFragment();
    $registry['customList'] = $view->compile();
}
开发者ID:madr,项目名称:urban-octo-rotary-phone,代码行数:28,代码来源:list.php

示例4: generate

 static function generate()
 {
     $form = new view(SITE . '/view/form/normal.phtml');
     $form->isFragment = true;
     return $form->compile();
 }
开发者ID:madr,项目名称:urban-octo-rotary-phone,代码行数:6,代码来源:form.php


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