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


PHP Url::fromCapturedRequest方法代码示例

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


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

示例1: view_product_overview


//.........这里部分代码省略.........
         $arrProductImages = array();
         foreach ($arrPictures as $index => $image) {
             $thumbnailPath = $pictureLink = '';
             if (empty($image['img']) || $image['img'] == ShopLibrary::noPictureName) {
                 // We have at least one picture on display already.
                 // No need to show "no picture" three times!
                 if ($havePicture) {
                     continue;
                 }
                 $thumbnailPath = self::$defaultImage;
                 $pictureLink = '#';
                 //"javascript:alert('".$_ARRAYLANG['TXT_NO_PICTURE_AVAILABLE']."');";
                 if (empty($arrDefaultImageSize)) {
                     $arrDefaultImageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsitePath() . self::$defaultImage);
                     self::scaleImageSizeToThumbnail($arrDefaultImageSize);
                 }
                 $arrSize = $arrDefaultImageSize;
             } else {
                 $thumbnailPath = \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesShopWebPath() . '/' . \ImageManager::getThumbnailFilename($image['img']);
                 if ($image['width'] && $image['height']) {
                     $pictureLink = contrexx_raw2encodedUrl(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesShopWebPath() . '/' . $image['img']) . '" rel="shadowbox[' . ($formId + 1) . ']';
                     // Thumbnail display size
                     $arrSize = array($image['width'], $image['height']);
                 } else {
                     $pictureLink = '#';
                     if (!file_exists(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsitePath() . $thumbnailPath)) {
                         continue;
                     }
                     $arrSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsitePath() . $thumbnailPath);
                 }
                 self::scaleImageSizeToThumbnail($arrSize);
                 // Use the first available picture in microdata, if any
                 if (!$havePicture) {
                     $picture_url = \Cx\Core\Routing\Url::fromCapturedRequest(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesShopWebPath() . '/' . $image['img'], \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath(), array());
                     self::$objTemplate->setVariable('SHOP_PRODUCT_IMAGE', $picture_url->toString());
                     //\DBG::log("Set image to ".$picture_url->toString());
                 }
             }
             $arrProductImages[] = array('THUMBNAIL' => contrexx_raw2encodedUrl($thumbnailPath), 'THUMBNAIL_SIZE' => $arrSize[3], 'THUMBNAIL_LINK' => $pictureLink, 'POPUP_LINK' => $pictureLink, 'POPUP_LINK_NAME' => $_ARRAYLANG['TXT_SHOP_IMAGE'] . ' ' . $index);
             $havePicture = true;
         }
         $i = 1;
         foreach ($arrProductImages as $arrProductImage) {
             // TODO: Instead of several numbered image blocks, use a single one repeatedly
             self::$objTemplate->setVariable(array('SHOP_PRODUCT_THUMBNAIL_' . $i => $arrProductImage['THUMBNAIL'], 'SHOP_PRODUCT_THUMBNAIL_SIZE_' . $i => $arrProductImage['THUMBNAIL_SIZE']));
             if (!empty($arrProductImage['THUMBNAIL_LINK'])) {
                 self::$objTemplate->setVariable(array('SHOP_PRODUCT_THUMBNAIL_LINK_' . $i => $arrProductImage['THUMBNAIL_LINK'], 'TXT_SEE_LARGE_PICTURE' => $_ARRAYLANG['TXT_SEE_LARGE_PICTURE']));
             } else {
                 self::$objTemplate->setVariable('TXT_SEE_LARGE_PICTURE', contrexx_raw2xhtml($objProduct->name()));
             }
             if ($arrProductImage['POPUP_LINK']) {
                 self::$objTemplate->setVariable('SHOP_PRODUCT_POPUP_LINK_' . $i, $arrProductImage['POPUP_LINK']);
             }
             self::$objTemplate->setVariable('SHOP_PRODUCT_POPUP_LINK_NAME_' . $i, $arrProductImage['POPUP_LINK_NAME']);
             ++$i;
         }
         $stock = $objProduct->stock_visible() ? $_ARRAYLANG['TXT_STOCK'] . ': ' . intval($objProduct->stock()) : '';
         $price = $objProduct->get_custom_price(self::$objCustomer, 0, 1, true);
         // If there is a discountprice and it's enabled
         $discountPrice = '';
         if ($objProduct->discountprice() > 0 && $objProduct->discount_active()) {
             $price = '<s>' . $price . '</s>';
             $discountPrice = $objProduct->get_custom_price(self::$objCustomer, 0, 1, false);
         }
         $groupCountId = $objProduct->group_id();
         $groupArticleId = $objProduct->article_id();
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:67,代码来源:Shop.class.php

示例2: array

    config.startupOutlineBlocks = true;
    config.allowedContent = true;

    config.ignoreEmptyParagraph = false;
    config.protectedSource.push(/<i[^>]*><\/i>/g);
    config.protectedSource.push(/<span[^>]*><\/span>/g);
    config.protectedSource.push(/<a[^>]*><\/a>/g);

    config.ignoreEmptyParagraph = false;
    config.protectedSource.push(/<i[^>]*><\/i>/g);
    config.protectedSource.push(/<span[^>]*><\/span>/g);
    config.protectedSource.push(/<a[^>]*><\/a>/g);

    config.tabSpaces = 4;
    config.baseHref = '<?php 
echo \Cx\Core\Routing\Url::fromCapturedRequest('', $cx->getWebsiteOffsetPath(), array())->toString();
?>
';
    config.templates_files = [ '<?php 
echo $defaultTemplateFilePath;
?>
' ];
    config.templates_replaceContent = <?php 
echo \Cx\Core\Setting\Controller\Setting::getValue('replaceActualContents', 'Wysiwyg') ? 'true' : 'false';
?>
;

    config.toolbar_Full = config.toolbar_Small = [
        ['Source','-','NewPage','Templates'],
        ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Scayt'],
        ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:31,代码来源:ckeditor.config.js.php

示例3: postInit

 /**
  * Initializes request
  */
 protected function postInit()
 {
     global $_CONFIG;
     // if path configuration was wrong in loadConfig(), Url is not yet initialized
     if (!$this->request) {
         // this makes \Env::get('Resolver')->getUrl() return a sensful result
         $request = !empty($_GET['__cap']) ? $_GET['__cap'] : '';
         $offset = $this->websiteOffsetPath;
         switch ($this->mode) {
             case self::MODE_FRONTEND:
             case self::MODE_BACKEND:
                 $this->request = new \Cx\Core\Routing\Model\Entity\Request($_SERVER['REQUEST_METHOD'], \Cx\Core\Routing\Url::fromCapturedRequest($request, $offset, $_GET));
                 break;
             case self::MODE_COMMAND:
             case self::MODE_MINIMAL:
                 try {
                     $this->request = new \Cx\Core\Routing\Model\Entity\Request($_SERVER['REQUEST_METHOD'], \Cx\Core\Routing\Url::fromRequest());
                 } catch (\Cx\Core\Routing\UrlException $e) {
                 }
                 break;
         }
     }
     //call post-init hooks
     $this->ch->callPostInitHooks();
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:28,代码来源:Cx.class.php

示例4: array

    
    config.ignoreEmptyParagraph = false;
    config.protectedSource.push(/<i[^>]*><\/i>/g);
    config.protectedSource.push(/<span[^>]*><\/span>/g);
    config.protectedSource.push(/<a[^>]*><\/a>/g);

    config.ignoreEmptyParagraph = false;
    config.protectedSource.push(/<i[^>]*><\/i>/g);
    config.protectedSource.push(/<span[^>]*><\/span>/g);
    config.protectedSource.push(/<a[^>]*><\/a>/g);

    config.tabSpaces = 4;
    config.baseHref = '<?php 
$request = !empty($_GET['__cap']) ? $_GET['__cap'] : '';
$offset = $cx->getWebsiteOffsetPath();
$requestUrl = \Cx\Core\Routing\Url::fromCapturedRequest($request, $offset, array());
echo $requestUrl->toString();
?>
';

    config.templates_files = [ '<?php 
echo $defaultTemplateFilePath;
?>
' ];
    
    config.templates_replaceContent = <?php 
echo \Cx\Core\Setting\Controller\Setting::getValue('replaceActualContents', 'Wysiwyg') ? 'true' : 'false';
?>
;

    config.toolbar_Full = config.toolbar_Small = [
开发者ID:Niggu,项目名称:cloudrexx,代码行数:30,代码来源:ckeditor.config.js.php


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