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


PHP PageRenderer::addJsFooterInlineCode方法代码示例

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


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

示例1: testAddJsFooterInlineCode

 /**
  * test add JS inline for footer
  */
 public function testAddJsFooterInlineCode()
 {
     $expectedReturnValue = 'var x = "testvar"';
     $this->fixture->addJsFooterInlineCode('test', 'var x = "testvar"');
     $out = $this->fixture->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_FOOTER);
     $this->assertContains($expectedReturnValue, $out);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:10,代码来源:PageRendererTest.php

示例2: addJSInlineCode

 /**
  * Add JS inline code
  *
  * @param string $name
  * @param string $block
  * @param boolean $compress
  * @param boolean $forceOnTop
  * @param string $position
  */
 public function addJSInlineCode($name, $block, $compress = true, $forceOnTop = false, $position = 'footer')
 {
     if ($position === 'header') {
         $this->pageRenderer->addJsInlineCode($name, $block, $compress, $forceOnTop);
     } else {
         $this->pageRenderer->addJsFooterInlineCode($name, $block, $compress, $forceOnTop);
     }
 }
开发者ID:beyond-agentur,项目名称:yag,代码行数:17,代码来源:HeaderInclusion.php

示例3: render

 /**
  * Render
  *
  * @param string $block
  */
 public function render()
 {
     $block = $this->renderChildren();
     if ($this->isCached()) {
         $this->pageRenderer->addJsFooterInlineCode($this->arguments['name'], $block, $this->arguments['compress'], $this->arguments['forceOnTop']);
     } else {
         // additionalFooterData not possible in USER_INT
         $GLOBALS['TSFE']->additionalFooterData[md5($this->arguments['name'])] = GeneralUtility::wrapJS($block);
     }
 }
开发者ID:ToddHossack,项目名称:ws_flexslider,代码行数:15,代码来源:AddJsFooterInlineCodeViewHelper.php

示例4: renderContent

 /**
  * Returns the fully rendered view
  *
  * @return string
  */
 public function renderContent()
 {
     $this->setupPage();
     $this->pageRenderer->setTitle($this->title);
     $this->loadJavaScripts();
     $this->setJavaScriptCodeArray();
     $this->loadStylesheets();
     $this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
     if ($this->moduleId) {
         $this->view->assign('moduleId', $this->moduleId);
     }
     if ($this->moduleName) {
         $this->view->assign('moduleName', $this->moduleName);
     }
     $renderedPage = $this->pageRenderer->render(PageRenderer::PART_HEADER);
     $renderedPage .= $this->view->render();
     $this->pageRenderer->addJsFooterInlineCode('updateSignals', BackendUtility::getUpdateSignalCode());
     $renderedPage .= $this->pageRenderer->render(PageRenderer::PART_FOOTER);
     return $renderedPage;
 }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:25,代码来源:ModuleTemplate.php

示例5: getAjaxFunction

 /**
  * Returns JS callback for the given action
  *
  * @param null $action
  * @param array $arguments
  * @param null $controller
  * @param null $extensionName
  * @param null $pluginName
  * @param string $format
  * @param string $section
  * @return string
  */
 public function getAjaxFunction($action = NULL, array $arguments = array(), $controller = NULL, $extensionName = NULL, $pluginName = NULL, $format = '', $section = 'footer')
 {
     // current element needs to have additional logic...
     $this->hijaxEventDispatcher->setIsHijaxElement(true);
     $request = $this->mvcDispatcher->getCurrentRequest();
     if ($request) {
         if ($action === NULL) {
             $action = $request->getControllerActionName();
         }
         if ($controller === NULL) {
             $controller = $request->getControllerName();
         }
         if ($extensionName === NULL) {
             $extensionName = $request->getControllerExtensionName();
         }
         if ($pluginName === NULL && TYPO3_MODE === 'FE') {
             $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controller, $action);
         }
         if ($pluginName === NULL) {
             $pluginName = $request->getPluginName();
         }
     }
     $settings = array('extension' => $extensionName, 'plugin' => $pluginName, 'controller' => $controller, 'format' => $format ? $format : 'html', 'action' => $action, 'arguments' => $arguments, 'settingsHash' => $this->mvcDispatcher->getCurrentListener() ? $this->mvcDispatcher->getCurrentListener()->getId() : '', 'namespace' => $extensionName && $pluginName ? $this->extensionService->getPluginNamespace($extensionName, $pluginName) : '');
     $functionName = 'extbaseHijax_' . md5(serialize($settings));
     $content = "; {$functionName}=function(settings, pendingElement, loaders) {";
     foreach ($settings as $k => $v) {
         $content .= "if (typeof settings.{$k} == 'undefined') settings.{$k}=" . json_encode($v) . ";";
     }
     $content .= "return jQuery.hijax(settings, pendingElement, loaders);};";
     if ($this->isCached()) {
         if ($section == 'footer') {
             $this->pageRenderer->addJsFooterInlineCode(md5($content), $content, FALSE, TRUE);
         } else {
             $this->pageRenderer->addJsInlineCode(md5($content), $content, FALSE, TRUE);
         }
     } else {
         // additionalFooterData not possible in USER_INT
         $GLOBALS['TSFE']->additionalHeaderData[md5($content)] = \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS($content);
     }
     return $functionName;
 }
开发者ID:seitenarchitekt,项目名称:extbase_hijax,代码行数:53,代码来源:JSBuilder.php

示例6: setValue

    /**
     * set the value
     * 
     * @param	string	$value value
     * @return 	\Ameos\AmeosForm\Elements\ElementAbstract this
     */
    public function setValue($value)
    {
        if ($value == 0) {
            $value = '';
        }
        parent::setValue($value);
        if ($value != '') {
            $this->pageRenderer->addJsFooterInlineCode('setvalue-datepicker-' . $this->getName() . '-' . $value, '
				if(document.getElementById("' . $this->getHtmlId() . '-datepicker")) {
					document.getElementById("' . $this->getHtmlId() . '-datepicker").value = moment(' . $value . ', "X").format("' . $this->configuration['format'] . '");
				}
			');
        } else {
            $this->pageRenderer->addJsFooterInlineCode('setvalue-datepicker-' . $this->getName() . '-' . $value, '
				if(document.getElementById("' . $this->getHtmlId() . '-datepicker")) {
					document.getElementById("' . $this->getHtmlId() . '-datepicker").value = "";
				}
			');
        }
        return $this;
    }
开发者ID:ameos,项目名称:ameos_form,代码行数:27,代码来源:Datepicker.php

示例7: render

 /**
  *
  * @param string $name
  * @param string $compress
  * @param string $forceOnTop
  * @return NULL
  */
 public function render($name, $compress = FALSE, $forceOnTop = FALSE)
 {
     $block = $this->renderChildren();
     $this->pageRenderer->addJsFooterInlineCode($name, $block, $compress, $forceOnTop);
     return NULL;
 }
开发者ID:hummal,项目名称:owl_slider,代码行数:13,代码来源:AddJsFooterInlineCodeViewHelper.php

示例8: render

 /**
  * @param string $src
  * @param string $type
  * @param boolean $compress
  * @param boolean $forceOnTop
  * @param string $allWrap
  * @param boolean $excludeFromConcatenation
  * @param string $section
  * @param boolean $preventMarkupUpdateOnAjaxLoad
  * @param boolean $moveToExternalFile
  * @param boolean $noCache
  * @param string $name
  * 
  * @return string
  */
 public function render($src = "", $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE, $section = 'footer', $preventMarkupUpdateOnAjaxLoad = false, $moveToExternalFile = false, $noCache = false, $name = '')
 {
     $content = $this->renderChildren();
     if ($this->ajaxDispatcher->getIsActive()) {
         if ($preventMarkupUpdateOnAjaxLoad) {
             $this->ajaxDispatcher->setPreventMarkupUpdateOnAjaxLoad(true);
         }
         // need to just echo the code in ajax call
         if (!$src) {
             if ($compress) {
                 $content = $this->compressScript($content);
             }
             return \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS($content);
         } else {
             return '<script type="' . htmlspecialchars($type) . '" src="' . htmlspecialchars($src) . '"></script>';
         }
     } else {
         if ($this->isCached()) {
             if ($noCache) {
                 if ($src) {
                     $content = '<script type="' . htmlspecialchars($type) . '" src="' . htmlspecialchars($src) . '"></script>';
                 } else {
                     if ($compress) {
                         $content = $this->compressScript($content);
                     }
                     $content = \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS($content);
                 }
                 $tslibFE = GeneralUtility::makeInstance('EssentialDots\\ExtbaseHijax\\Tslib\\FE\\Hook');
                 /* @var $tslibFE \EssentialDots\ExtbaseHijax\Tslib\FE\Hook */
                 if ($section == 'footer') {
                     $tslibFE->addNonCacheableFooterCode($name ? $name : md5($content), $content);
                 } else {
                     $tslibFE->addNonCacheableHeaderCode($name ? $name : md5($content), $content);
                 }
                 return '';
             } else {
                 if (!$src && $moveToExternalFile) {
                     $src = 'typo3temp' . DIRECTORY_SEPARATOR . 'extbase_hijax' . DIRECTORY_SEPARATOR . md5($content) . '.js';
                     \TYPO3\CMS\Core\Utility\GeneralUtility::writeFileToTypo3tempDir(PATH_site . $src, $content);
                     if ($GLOBALS['TSFE']) {
                         if ($GLOBALS['TSFE']->baseUrl) {
                             $src = $GLOBALS['TSFE']->baseUrl . $src;
                         } elseif ($GLOBALS['TSFE']->absRefPrefix) {
                             $src = $GLOBALS['TSFE']->absRefPrefix . $src;
                         }
                     }
                 }
                 if (!$src) {
                     if ($section == 'footer') {
                         $this->pageRenderer->addJsFooterInlineCode($name ? $name : md5($content), $content, $compress, $forceOnTop);
                     } else {
                         $this->pageRenderer->addJsInlineCode($name ? $name : md5($content), $content, $compress, $forceOnTop);
                     }
                 } else {
                     if ($section == 'footer') {
                         $this->pageRenderer->addJsFooterFile($src, $type, $compress, $forceOnTop, $allWrap, $excludeFromConcatenation);
                     } else {
                         $this->pageRenderer->addJsFile($src, $type, $compress, $forceOnTop, $allWrap, $excludeFromConcatenation);
                     }
                 }
             }
         } else {
             // additionalFooterData not possible in USER_INT
             if (!$src) {
                 $GLOBALS['TSFE']->additionalHeaderData[$name ? $name : md5($content)] = \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS($content);
             } else {
                 $GLOBALS['TSFE']->additionalHeaderData[$name ? $name : md5($content)] = '<script type="' . htmlspecialchars($type) . '" src="' . htmlspecialchars($src) . '"></script>';
             }
         }
     }
     return '';
 }
开发者ID:seitenarchitekt,项目名称:extbase_hijax,代码行数:87,代码来源:ScriptViewHelper.php


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