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


PHP container函数代码示例

本文整理汇总了PHP中container函数的典型用法代码示例。如果您正苦于以下问题:PHP container函数的具体用法?PHP container怎么用?PHP container使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: dispatch

 private static function dispatch()
 {
     $route = Utils::get('appDispatch');
     if (!$route instanceof Container) {
         context()->is404();
         $route = container()->getRoute();
     }
     if (true !== container()->getIsDispatched()) {
         if (true !== $route->getCache()) {
             context()->dispatch($route);
         } else {
             $redis = context()->redis();
             $key = sha1(serialize($route->assoc())) . '::routeCache';
             $cached = $redis->get($key);
             if (!strlen($cached)) {
                 ob_start();
                 context()->dispatch($route);
                 $cached = ob_get_contents();
                 ob_end_clean();
                 $redis->set($key, $cached);
                 $ttl = Config::get('application.route.cache', 7200);
                 $redis->expire($key, $ttl);
             }
             echo $cached;
         }
     }
 }
开发者ID:noikiy,项目名称:inovi,代码行数:27,代码来源:Bootstrap.php

示例2: content_block

 function content_block()
 {
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     //  Create the form
     $form = new FlipTurnEditHomePageForm("Home Edit", null, '100%');
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  Add the Form Processor to the container.
     //  If the Form Processor was succesful, display
     //  some statistics about the uploaded file.
     if ($fp->is_action_successful()) {
         //$container->add($form->get_action_message()) ;
         //  Add the Form Processor to the container.
         $container->add(html_br(2), $fp);
     } else {
         $container->add($fp);
     }
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:25,代码来源:home_edit.php

示例3: content_block

 function content_block()
 {
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     //  Create the form
     $form = new ResultsQueuePurgeForm("Purge Results Queue", $_SERVER['PHP_SELF'], 600);
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  Add the Form Processor to the container.
     //  If the Form Processor was succesful, display
     //  some statistics about the uploaded file.
     if ($fp->is_action_successful()) {
         //$container->add($form->get_action_message()) ;
         //  Add the Form Processor to the container.
         $container->add(html_br(2), $fp);
     } else {
         $container->add($fp);
     }
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:25,代码来源:queue_purge.php

示例4: content_block

 function content_block()
 {
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     //  Create the form
     if ($this->user_is_logged_in()) {
         $form = new FlipTurnAdminLogoutForm("Admin Flip Turn Logout", null, 350);
     } else {
         $form = new FlipTurnAdminLoginForm("Admin Flip Turn Login", null, 350);
     }
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  Add the Form Processor to the container.
     //  If the Form Processor was succesful, display
     //  some a welcome message.
     if ($fp->is_action_successful()) {
         //  Redirect to Member page on successful login
         //die($_SERVER['PHP_SELF']) ;
         $url = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php';
         header("Location: {$url}");
         exit;
         $container->add(html_br(2), $fp);
     } else {
         $container->add($fp);
     }
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:32,代码来源:login-logout.php

示例5: close

 public function close()
 {
     $configs = container()->getConfig()->getDb();
     $config = isAke($configs, $this->entity);
     if (empty($config)) {
         throw new Exception("Database configuration does not exist.");
     }
     $username = $config->getUsername();
     if (empty($username)) {
         throw new Exception("Username is mandatory to connect database.");
     }
     $adapter = $config->getAdapter();
     $password = $config->getPassword();
     $dbName = $config->getDatabase();
     $host = $config->getHost();
     $dsn = $config->getDsn();
     if (!empty($dsn)) {
         $adapter = 'mysql';
     }
     $connexions = Utils::get('SQLConnexions');
     if (null === $connexions) {
         $connexions = array();
     }
     $keyConnexion = sha1(serialize(array("{$adapter}:dbname={$dbName};host={$host}", $username, $password)));
     if (Arrays::exists($keyConnexion, $connexions)) {
         $connexions[$keyConnexion] = null;
         Utils::set('SQLConnexions', $connexions);
     }
     $this->_isConnected = false;
     return $this;
 }
开发者ID:schpill,项目名称:thin,代码行数:31,代码来源:Sql.php

示例6: form

 /**
  * Este metodo construye el formulario en sí.
  */
 function form()
 {
     $ret_val = container();
     $table =& html_table($this->_width, 0, 3);
     $table->set_class("mainInterfaceWidth");
     //$table->set_style("border: 1px solid");
     $row = html_tr("");
     $col1 = html_td("");
     $col1->set_tag_attribute("align", "right");
     $col1->add(html_b(agt("Idioma")));
     $col2 = html_td("");
     $col2->set_tag_attribute("align", "left");
     $col2->add($this->element_form("miguel_lang"));
     $row->add($col1, $col2);
     $table->add($row);
     $ret_val->add($table);
     $ret_val->add(html_br(2));
     $table =& html_table($this->_width, 0, 0);
     $table->set_class("table100 main-info-cell");
     $row = html_tr("");
     $col1 = html_td("");
     $col1->set_tag_attribute("align", "left");
     $col1->add($this->element_form("Salir"));
     $col2 = html_td("");
     $col2->set_tag_attribute("align", "right");
     $col2->add($this->element_form("Siguiente"));
     $row->add($col1, $col2);
     $table->add($row);
     $ret_val->add($table);
     return $ret_val;
 }
开发者ID:BackupTheBerlios,项目名称:migueloo,代码行数:34,代码来源:miguel_selectlangform.class.php

示例7: content_block

 function content_block()
 {
     //  Add the InfoTableCSS so the tables look right
     $this->add_head_css(new InfoTableCSS());
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     //  Create the form
     $form = new SDIFFileUploadForm("Upload SDIF File", $_SERVER['PHP_SELF'], 600);
     $form->setUploadFileLabel("SDIF Filename");
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  If the Form Processor was succesful, display
     //  some statistics about the uploaded file.
     if ($fp->is_action_successful()) {
         $sd3fileinfo = $form->get_file_info();
         $container->add($fp, $form->get_file_info_table());
     } else {
         //  Add the Form Processor to the container.
         $container->add($fp);
     }
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:27,代码来源:queue_upload.php

示例8: form

 /**
  * Este metodo construye el formulario en sí.
  */
 function form()
 {
     $ret_val = container();
     $table =& html_table($this->_width, 0, 2);
     $table->set_class("table100 main-info-cell");
     $row0 = html_tr("");
     $col0 = html_td("");
     $col0->set_tag_attribute("align", "center");
     $col0->set_tag_attribute("colspan", "2");
     $col0->add($this->element_form("Licence"));
     $row0->add($col0);
     $table->add($row0);
     $row00 = html_tr("");
     $col00 = html_td("");
     $col00->set_tag_attribute("align", "center");
     $col00->set_tag_attribute("colspan", "2");
     $col00->add(html_a(Util::app_urlPath('install/include/gpl_print.txt'), agt('Versión Imprimible')));
     $row00->add($col00);
     $table->add($row00);
     $row = html_tr("");
     $col1 = html_td("");
     $col1->set_tag_attribute("align", "left");
     $col1->add($this->element_form("Salir"));
     $container = container();
     $container->add($this->element_form("Regresar"));
     $container->add($this->element_form("Acepto"));
     $col2 = html_td("");
     $col2->set_tag_attribute("align", "right");
     $col2->add($container);
     $row->add($col1, $col2);
     $table->add($row);
     $ret_val->add($table);
     return $ret_val;
 }
开发者ID:BackupTheBerlios,项目名称:migueloo,代码行数:37,代码来源:miguel_licenceform.class.php

示例9: content_block

 function content_block()
 {
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     $sdifqueue = new SDIFResultsQueue();
     if (!$sdifqueue->ValidateQueue()) {
         $msgs = $sdifqueue->get_status_message();
         foreach ($msgs as $msg) {
             $container->add($this->status_message($msg['msg'], $msg['severity']));
         }
         return $container;
     }
     //  Create the form
     $form = new SDIFQueueProcessForm("Process SDIF Queue", $_SERVER['PHP_SELF'], 600);
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  Add the Form Processor to the container.
     //  If the Form Processor was succesful, display
     //  some statistics about the uploaded file.
     if ($fp->is_action_successful()) {
         //$container->add($form->get_action_message()) ;
         //  Add the Form Processor to the container.
         $container->add(html_br(2), $fp);
     } else {
         $container->add($fp);
     }
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:33,代码来源:queue_process.php

示例10: content_block

 function content_block()
 {
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     //  Create the form
     $form = new SwimmerAddForm("Add Swimmer", null, 600);
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  Add the Form Processor to the container.
     //  If the Form Processor was succesful, display
     //  some statistics about the uploaded file.
     if ($fp->is_action_successful()) {
         //  Add the InfoTableCSS so the tables look right
         $this->add_head_css(new DefaultGUIDataListCSS());
         $swimmers = new SwimmersDataList("Swimmers", '100%', "swimmerid");
         $div = html_div();
         $div->set_id("swimmersgdl");
         $div->add($swimmers);
         $container->add($div);
         //  Add the Form Processor to the container.
         $container->add(html_br(2), $fp);
     } else {
         $container->add($fp);
     }
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:31,代码来源:swimmer_add.php

示例11: init

 public function init()
 {
     $this->_url = $this->view->_url = context('url');
     $this->action = container()->getRoute()->getAction();
     $this->view->isLogged = false;
     $this->can();
 }
开发者ID:noikiy,项目名称:inovi,代码行数:7,代码来源:staticController.php

示例12: content_block

 function content_block()
 {
     //  Add the InfoTableCSS so the tables look right
     $this->add_head_css(new DefaultGUIDataListCSS());
     //  This allows passing arguments eithers as a GET or a POST
     $scriptargs = array_merge($_GET, $_POST);
     //  The swimteamid is the argument which must be
     //  dealt with differently for GET and POST operations
     if (array_key_exists("swimteamid", $scriptargs)) {
         $swimteamid = $scriptargs["swimteamid"];
     } else {
         if (array_key_exists("_swimteamid", $scriptargs)) {
             $swimteamid = $scriptargs["_swimteamid"];
         } else {
             if (array_key_exists(FT_DB_PREFIX . "radio", $scriptargs)) {
                 $swimteamid = $scriptargs[FT_DB_PREFIX . "radio"][0];
             } else {
                 $swimteamid = null;
             }
         }
     }
     $container = container();
     $it = new SwimTeamInfoTable("Swim Team Details");
     $it->setSwimTeamId($swimteamid);
     $it->BuildInfoTable();
     $container->add($it);
     $container->add(FlipTurnGUIButtons::getBackHomeButtons());
     return $container;
 }
开发者ID:rjoverph,项目名称:flip-turn,代码行数:29,代码来源:swimteam_details.php

示例13: form

 function form()
 {
     $table = html_table('100%', 0, 1, 3);
     $elem = html_td('color1-bg', 'left', container(html_b('Ruta del archivo CSV'), $this->element_form('path'), $this->add_action('Procesar')));
     $elem->set_id('identification');
     $table->add_row($elem);
     return $table;
 }
开发者ID:BackupTheBerlios,项目名称:migueloo,代码行数:8,代码来源:miguel_adduserlistForm.class.php

示例14: factory

 /**
  * Resolve a factory. Keep in mind that factory would be resolved via container method.
  * So make sure if the accessor is an alias, register it on a container by calling:
  *
  * ```php
  * container()->alias('FooClass', 'foo');
  * ```
  *
  * @param string $factory Name of your registered factory
  *
  * @return mixed
  */
 public function factory($factory)
 {
     if ($this->hasFactory($factory)) {
         if (!$this->factoryHasBeenResolved($factory)) {
             $this->resolvedFactories[$factory] = container($this->factories[$factory]);
         }
         return $this->resolvedFactories[$factory];
     }
 }
开发者ID:krisanalfa,项目名称:docolight,代码行数:21,代码来源:HasFactories.php

示例15: url

 /**
  * Create a root-relative url.
  *
  * @param string $path
  * @param array $queryParams Optional query string parameters
  * @return string
  */
 function url($path = '', array $queryParams = [])
 {
     $uri = container('request')->getUri();
     $url = $uri->getBasePath() . '/' . ltrim($path, '/');
     if ($queryParams) {
         $url .= '?' . http_build_query($queryParams);
     }
     return $url;
 }
开发者ID:bvqbao,项目名称:app-skeleton,代码行数:16,代码来源:helpers.php


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