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


PHP ObjectManagerInterface::getContext方法代码示例

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


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

示例1: render

    /**
     * Returns the HTML needed to include ExtJS, that is, CSS and JS includes.
     *
     * = Examples =
     *
     * <code title="Simple">
     * {namespace ext=TYPO3\ExtJS\ViewHelpers}
     *  ...
     * <ext:include/>
     * </code>
     * Renders the script and link tags needed to include everything needed to
     * use ExtJS.
     *
     * <code title="Use a specific theme">
     * <ext:include theme="xtheme-gray"/>
     * </code>
     *
     * @param string $theme The theme to include, simply the name of the CSS
     * @param boolean $debug Whether to use the debug version of ExtJS
     * @param boolean $includeStylesheets Include ExtJS CSS files if true
     * @return string HTML needed to include ExtJS
     * @api
     */
    public function render($theme = 'xtheme-blue', $debug = NULL, $includeStylesheets = TRUE)
    {
        if ($debug === NULL) {
            $debug = $this->objectManager->getContext()->isDevelopment() ?: FALSE;
        }
        $baseUri = $this->resourcePublisher->getStaticResourcesWebBaseUri() . 'Packages/TYPO3.ExtJS/';
        $output = '';
        if ($includeStylesheets) {
            $output .= '
<link rel="stylesheet" href="' . $baseUri . 'CSS/ext-all-notheme.css" />
<link rel="stylesheet" href="' . $baseUri . 'CSS/' . $theme . '.css" />';
        }
        if ($debug) {
            $output .= '
<script type="text/javascript" src="' . $baseUri . 'JavaScript/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="' . $baseUri . 'JavaScript/ext-all-debug.js"></script>';
        } else {
            $output .= '
<script type="text/javascript" src="' . $baseUri . 'JavaScript/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="' . $baseUri . 'JavaScript/ext-all.js"></script>';
        }
        $output .= '
<script type="text/javascript">
	Ext.BLANK_IMAGE_URL = \'' . $baseUri . 'images/default/s.gif\';
	Ext.FlashComponent.EXPRESS_INSTALL_URL = \'' . $baseUri . 'Flash/expressinstall.swf\';
	Ext.chart.Chart.CHART_URL = \'' . $baseUri . 'Flash/chart.swf\';
</script>
';
        return $output;
    }
开发者ID:neos,项目名称:extjs,代码行数:53,代码来源:IncludeViewHelper.php

示例2: initializeObject

 /**
  * @return void
  */
 public function initializeObject()
 {
     // flush routing caches if in Development context & routing settings changed
     if ($this->objectManager->getContext()->isDevelopment() && $this->routeCache->get('routingSettings') !== $this->routingSettings) {
         $this->flushCaches();
         $this->routeCache->set('routingSettings', $this->routingSettings);
     }
 }
开发者ID:mkeitsch,项目名称:flow-development-collection,代码行数:11,代码来源:RouterCachingService.php

示例3: preToolbarRendering

 /**
  * TODO: Document this Method! ( assignVariables )
  */
 public function preToolbarRendering()
 {
     $memoryUsage = memory_get_peak_usage(TRUE) / 1024 / 1024;
     $memoryUsage = number_format($memoryUsage, 1) . ' MB';
     \Debug\Toolbar\Service\Collector::getModule('Environment')->getToolbar()->addIcon('info-sign')->addText($memoryUsage)->getPopup()->addTable(array('PHP Version' => PHP_VERSION, 'Flow Context' => $this->objectManager->getContext(), 'Flow Version' => FLOW_VERSION_BRANCH))->getPanel()->addTable(array('PHP Version' => PHP_VERSION, 'Flow Context' => $this->objectManager->getContext(), 'Flow Version' => FLOW_VERSION_BRANCH));
     return;
     #$configurations = array();
     #foreach ($configurations as $configurationName => $configurationConstant) {
     #    $configuration = $this->configurationManager->getConfiguration($configurationConstant);
     #    $configurations[$configurationName] = \Symfony\Component\Yaml\Yaml::dump($configuration, 10);
     #}
     #$configurations["Constants"] = \Symfony\Component\Yaml\Yaml::dump(get_defined_constants(), 10);
     #$this->view->assign('configurations', $configurations);
 }
开发者ID:radmiraal,项目名称:Debug.Toolbar,代码行数:17,代码来源:EnvironmentDebugger.php

示例4: getSubProcess

 /**
  * @return SubProcess
  */
 protected function getSubProcess()
 {
     if ($this->subProcess === NULL) {
         /** @var CacheManager $cacheManager */
         $cacheManager = $this->objectManager->get('TYPO3\\Flow\\Cache\\CacheManager');
         if ($cacheManager->hasCache('Flow_Security_Policy_Privilege_Method')) {
             $cacheManager->getCache('Flow_Security_Policy_Privilege_Method')->flush();
         }
         $objectConfigurationCache = $cacheManager->getCache('Flow_Object_Configuration');
         $objectConfigurationCache->remove('allAspectClassesUpToDate');
         $objectConfigurationCache->remove('allCompiledCodeUpToDate');
         $cacheManager->getCache('Flow_Object_Classes')->flush();
         $this->subProcess = new SubProcess($this->objectManager->getContext());
     }
     return $this->subProcess;
 }
开发者ID:animaltool,项目名称:webinterface,代码行数:19,代码来源:FeatureContext.php

示例5: callRenderMethod

 /**
  * Call the render() method and handle errors.
  *
  * @return string the rendered ViewHelper
  * @throws Exception
  */
 protected function callRenderMethod()
 {
     $renderMethodParameters = array();
     /** @var $argumentDefinition ArgumentDefinition */
     foreach ($this->argumentDefinitions as $argumentName => $argumentDefinition) {
         if ($argumentDefinition->isMethodParameter()) {
             $renderMethodParameters[$argumentName] = $this->arguments[$argumentName];
         }
     }
     try {
         return call_user_func_array(array($this, 'render'), $renderMethodParameters);
     } catch (Exception $exception) {
         if (!$this->objectManager->getContext()->isProduction()) {
             throw $exception;
         } else {
             $this->systemLogger->log('An Exception was captured: ' . $exception->getMessage() . '(' . $exception->getCode() . ')', LOG_ERR, 'TYPO3.Fluid', get_class($this));
             return '';
         }
     }
 }
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:26,代码来源:AbstractViewHelper.php

示例6: handle

 /**
  * @param ComponentContext $componentContext
  * @return void
  */
 public function handle(ComponentContext $componentContext)
 {
     $httpResponse = $componentContext->getHttpResponse();
     $httpResponse->setHeader($this->options['headerName'], $this->objectManager->getContext()->__toString());
 }
开发者ID:robotic-brain,项目名称:flow-context-header,代码行数:9,代码来源:HttpHeaderComponent.php


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