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


PHP Backend::add方法代码示例

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


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

示例1: __call

 public function __call($method, $args)
 {
     $id = md5($method . serialize($args) . serialize(get_object_vars($this->object)));
     if (($value = $this->backend->get($id)) === null) {
         $value = call_user_func_array(array($this->object, $method), $args);
         $this->backend->add($id, $value);
     }
     return $value;
 }
开发者ID:maximebf,项目名称:cachecache,代码行数:9,代码来源:ObjectWrapper.php

示例2: html_list

 public function html_list($document)
 {
     Backend::add('Sub Title', $document->getMeta('name'));
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::add('Object', $document);
     Backend::addContent(Render::renderFile('document_list.tpl.php'));
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:Document.obj.php

示例3: main

function main()
{
    $start = microtime(true);
    require BACKEND_FOLDER . '/classes/Backend.obj.php';
    Backend::init();
    Backend::add('start', $start);
    Controller::serve();
}
开发者ID:jrgns,项目名称:backend-php,代码行数:8,代码来源:index.php

示例4: html_display

 public function html_display($content)
 {
     Backend::add('Sub Title', 'Revisions for ' . $content->array['name']);
     Backend::add('content', $content);
     Backend::add('revisions', $content->object->revisions);
     Backend::addContent(Render::renderFile('content_revision.display.tpl.php'));
     return true;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:8,代码来源:ContentRevision.obj.php

示例5: html_index

 function html_index($result)
 {
     if (Render::checkTemplateFile('home.index.tpl.php')) {
         Backend::addContent(Render::file('home.index.tpl.php'));
     } else {
         Backend::add('Sub Title', 'Welcome');
         Backend::addContent('<h3>Welcome to #Title#</h3><p>The code for this URL is in the Home Controller</p>');
     }
     return true;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:10,代码来源:Home.obj.php

示例6: get_list

 function get_list($start, $count, array $options = array())
 {
     $Assignments = new AssignmentObj();
     if ($start === 'all') {
         $limit = 'all';
     } else {
         $limit = "{$start}, {$count}";
     }
     $conditions = array('`assignments`.`active` = 1');
     $joins = array(array('type' => 'LEFT', 'table' => '`roles`', 'conditions' => array('`roles`.`id` = `assignments`.`role_id`', '`roles`.`active` = 1')));
     $fields = array('`assignments`.*', '`roles`.`name` AS `role`');
     list($query, $params) = $Assignments->getSelectSQL(array('conditions' => $conditions, 'joins' => $joins, 'fields' => $fields, 'limit' => $limit));
     $Assignments->read(array('query' => $query, 'parameters' => $params));
     Backend::add('Assignments', $Assignments);
     Backend::addContent(Render::renderFile('assignment_list.tpl.php'));
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:16,代码来源:Assignment.obj.php

示例7: get_list

 public function get_list($start, $count, array $options = array())
 {
     $toret = false;
     Backend::add('Sub Title', 'List');
     $obj_name = class_name(Controller::$area) . 'Obj';
     if (class_exists($obj_name, true)) {
         $object = new $obj_name();
         if ($start === 'all') {
             $object->read(array());
         } else {
             $object->read(array('limit' => "{$start}, {$count}"));
         }
         $toret = $object;
     } else {
         Controller::whoops();
     }
     return $toret;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:18,代码来源:Image.obj.php

示例8: dirname

<?php

require_once dirname(__FILE__) . '/../Backend.class.php';
$be = new Backend();
print_r($be->add('test', __DIR__ . '/scripts/test.php', array('writelog' => TRUE)));
print_r($be->update('test', array('guard' => TRUE)));
print_r($be->start('test'));
// 在系统中 kill 该进程,过1分钟后查看到进程自动恢复
开发者ID:hwsyy,项目名称:php-backend-server,代码行数:8,代码来源:guarder.php

示例9: html_search

 public function html_search($result)
 {
     foreach ($result as $name => $value) {
         Backend::add($name, $value);
     }
     Backend::addContent(Render::file('backend_search.tpl.php'));
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:Content.obj.php

示例10: html_define

 public function html_define($values)
 {
     if ($values) {
         if ($values['function']) {
             Backend::add('Sub Title', $values['class'] . '::' . $values['function']);
             Backend::addContent(Render::renderFile('api_function.tpl.php', $values));
         } else {
             Backend::add('Sub Title', $values['class']);
             Backend::addContent(Render::renderFile('api_class.tpl.php', $values));
         }
     }
     return true;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:13,代码来源:API.obj.php

示例11: whoops

 public function whoops($title, $message, $code_hint = false)
 {
     Backend::add('Sub Title', $title);
     Backend::addContent('<ht>' . $message . '<hr>');
     parent::whoops($title, $message, $code_hint);
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:6,代码来源:HtmlView.obj.php

示例12: add

 /**
  * {@inheritDoc}
  */
 public function add($id, $value, $ttl = null)
 {
     $id = $this->id($id);
     $ttl = $this->computeTTL($ttl);
     return $this->backend->add($id, $value, $ttl);
 }
开发者ID:maximebf,项目名称:cachecache,代码行数:9,代码来源:Cache.php

示例13: hook_post_display

 /**
  * This function adds all styles and scripts to the HTML. It also retrieves primary and secondary links from the App
  *
  */
 public static function hook_post_display($data, $controller)
 {
     Backend::add('Styles', array_unique(array_filter(Backend::getStyles())));
     Backend::add('Scripts', array_unique(array_filter(Backend::getScripts())));
     return $data;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:10,代码来源:ChunkView.obj.php

示例14: hook_start

 public static function hook_start()
 {
     $user = self::check();
     if ($user && in_array('superadmin', $user->roles) && !Backend::getConfig('application.NoSuperWarning')) {
         Backend::addInfo('You are the super user. Be carefull, careless clicking costs lives...');
     }
     self::$current_user = $user;
     Backend::add('BackendUser', $user);
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:9,代码来源:BackendUser.obj.php

示例15: html_import

 public function html_import($result)
 {
     switch (true) {
         case $result instanceof DBObject:
             if (!Backend::get('Sub Title')) {
                 Backend::add('Sub Title', 'Import');
                 Backend::add('Sub Title', 'Import ' . $result->getMeta('name'));
             }
             $template_file = array($result->getArea() . '.import.tpl.php', $result->getArea() . '/import.tpl.php');
             if (!Render::checkTemplateFile($template_file[0]) && !Render::checkTemplateFile($template_file[1])) {
                 $template_file = 'std_import.tpl.php';
             }
             Backend::addContent(Render::file($template_file, array('db_object' => $result)));
             break;
         case is_numeric($result) && $result >= 0:
             Backend::addSuccess($result . ' records imported');
             Controller::redirect('?q=' . Controller::$area . '/list');
             break;
         default:
             Controller::redirect();
             break;
     }
     return $result;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:24,代码来源:TableCtl.obj.php


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