本文整理汇总了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();
示例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'],
示例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();
}
示例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 = [