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


PHP Environment::isEmbedded方法代码示例

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


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

示例1: dispatch

 /**
  * @see \Components\Http_Scriptlet::dispatch() dispatch
  */
 public static function dispatch(Http_Scriptlet_Context $context_, Uri $uri_)
 {
     $response = $context_->getResponse();
     $content = null;
     try {
         // FIXME Temporary fix - create a explicit route for ui/scriptlet/embedded.
         if (Environment::isEmbedded()) {
             $scriptlet = new Ui_Scriptlet_Embedded();
             $scriptlet->request = $context_->getRequest();
             $scriptlet->response = $context_->getResponse();
             $method = $scriptlet->request->getMethod();
             if (false === method_exists($scriptlet, strtolower($method))) {
                 throw new Http_Exception('ui/scriptlet', null, Http_Exception::NOT_FOUND);
             }
             $content = $scriptlet->{$method}();
         } else {
             $content = parent::dispatch($context_, $uri_);
         }
     } catch (\Exception $e) {
         Runtime::addException($e);
         if ($e instanceof Http_Exception) {
             $e->sendHeader();
         }
     }
     echo $content;
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.ui,代码行数:29,代码来源:scriptlet.php

示例2: __construct

 public function __construct()
 {
     Environment::isEmbedded(true);
     $this->template = __DIR__ . '/embedded.tpl';
     $this->script('ui/jquery/jquery-1.11.2.min', false, false);
     $this->script('runtime/libstd');
     $this->script('ui/jquery/mobile/jquery.mobile.touch.min');
     $this->script('ui/common');
     $this->style('ui/common');
     $this->panel = new Ui_Panel('ui-panel');
     $this->panel->scriptlet = $this;
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.ui,代码行数:12,代码来源:embedded.php

示例3: display

 /**
  * Displays this panel or sub-panel.
  *
  * @param string $panel_ Name of sub-panel to display
  *
  * @throws Ui_Panel_Exception
  */
 public function display($panel_ = null)
 {
     if (null !== $panel_) {
         if (isset($this->m_children[$panel_])) {
             return $this->m_children[$panel_]->display();
         }
         return;
     }
     if (null === $this->m_form) {
         if (Environment::isEmbedded() && null !== $this->callback) {
             throw new Ui_Panel_Exception('ui/panel', 'Panels with callbacks require a form in embedded mode.');
         }
     } else {
         if ($this->m_form->id() === $this->id()) {
             $this->m_attributes['ui-panel-form'] = null;
             $this->m_classes['ui_panel_form'] = 'ui_panel_form';
             if ($this->ajaxEnabled) {
                 if (Environment::isEmbedded()) {
                     $path = [$this->name => \str\typeToPath(get_class($this))];
                     $panel = $this;
                     while ($panel = $panel->parent) {
                         $path[$panel->name] = \str\typeToPath(get_class($panel));
                     }
                     $this->m_attributes['ui-panel-path'] = json_encode(array_reverse($path));
                 }
             } else {
                 $this->tag = 'form';
             }
             if (isset($this->m_attributes['action'])) {
                 $this->m_attributes['action'] = $this->m_formProperties['action'];
             }
             $this->m_attributes['accept-charset'] = $this->m_formProperties['accept-charset'];
             $this->m_attributes['enctype'] = $this->m_formProperties['enctype'];
             $this->m_attributes['method'] = $this->m_formProperties['method'];
         }
     }
     if (null !== $this->tag) {
         printf('<%s id="%s" %s>', $this->tag, $this->id(), $this->attributes());
         if ('form' === $this->tag) {
             printf('<input type="hidden" name="ui-panel-submitted" value="%s">', $this->id());
         }
     }
     echo $this->render();
     if (null !== $this->tag) {
         printf('</%s>', $this->tag);
     }
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.ui,代码行数:54,代码来源:panel.php


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