當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。