本文整理汇总了PHP中Magento\Framework\UrlInterface::addSessionParam方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlInterface::addSessionParam方法的具体用法?PHP UrlInterface::addSessionParam怎么用?PHP UrlInterface::addSessionParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\UrlInterface
的用法示例。
在下文中一共展示了UrlInterface::addSessionParam方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSampleColumn
/**
* @return array
*/
protected function getSampleColumn()
{
$sampleContainer['arguments']['data']['config'] = ['componentType' => Container::NAME, 'formElement' => Container::NAME, 'component' => 'Magento_Ui/js/form/components/group', 'label' => __('File'), 'dataScope' => ''];
$sampleType['arguments']['data']['config'] = ['formElement' => Form\Element\Select::NAME, 'componentType' => Form\Field::NAME, 'component' => 'Magento_Downloadable/js/components/upload-type-handler', 'dataType' => Form\Element\DataType\Text::NAME, 'dataScope' => 'type', 'options' => $this->typeUpload->toOptionArray(), 'typeFile' => 'sample_file', 'typeUrl' => 'sample_url'];
$sampleUrl['arguments']['data']['config'] = ['formElement' => Form\Element\Input::NAME, 'componentType' => Form\Field::NAME, 'dataType' => Form\Element\DataType\Text::NAME, 'dataScope' => 'sample_url', 'placeholder' => 'URL', 'validation' => ['required-entry' => true, 'validate-url' => true]];
$sampleUploader['arguments']['data']['config'] = ['formElement' => 'fileUploader', 'componentType' => 'fileUploader', 'component' => 'Magento_Downloadable/js/components/file-uploader', 'elementTmpl' => 'Magento_Downloadable/components/file-uploader', 'fileInputName' => 'samples', 'uploaderConfig' => ['url' => $this->urlBuilder->addSessionParam()->getUrl('adminhtml/downloadable_file/upload', ['type' => 'samples', '_secure' => true])], 'dataScope' => 'file', 'validation' => ['required-entry' => true]];
return $this->arrayManager->set('children', $sampleContainer, ['sample_type' => $sampleType, 'sample_url' => $sampleUrl, 'sample_file' => $sampleUploader]);
}
示例2: addLinkFile
/**
* Add Link File info into $linkData
*
* @param array $linkData
* @param LinkInterface $link
* @return array
*/
protected function addLinkFile(array $linkData, LinkInterface $link)
{
$linkFile = $link->getLinkFile();
if ($linkFile) {
$file = $this->downloadableFile->getFilePath($this->linkModel->getBasePath(), $linkFile);
if ($this->downloadableFile->ensureFileInFilesystem($file)) {
$linkData['file'][0] = ['file' => $linkFile, 'name' => $this->downloadableFile->getFileFromPathFile($linkFile), 'size' => $this->downloadableFile->getFileSize($file), 'status' => 'old', 'url' => $this->urlBuilder->addSessionParam()->getUrl('adminhtml/downloadable_product_edit/link', ['id' => $link->getId(), 'type' => 'link', '_secure' => true])];
}
}
return $linkData;
}
示例3: addSampleFile
/**
* Add Sample File info into $sampleData
*
* @param array $sampleData
* @param SampleInterface $sample
* @return array
*/
protected function addSampleFile(array $sampleData, SampleInterface $sample)
{
$sampleFile = $sample->getSampleFile();
if ($sampleFile) {
$file = $this->downloadableFile->getFilePath($this->sampleModel->getBasePath(), $sampleFile);
if ($this->downloadableFile->ensureFileInFilesystem($file)) {
$sampleData['file'][0] = ['file' => $sampleFile, 'name' => $this->downloadableFile->getFileFromPathFile($sampleFile), 'size' => $this->downloadableFile->getFileSize($file), 'status' => 'old', 'url' => $this->urlBuilder->addSessionParam()->getUrl('adminhtml/downloadable_product_edit/sample', ['id' => $sample->getId(), '_secure' => true])];
}
}
return $sampleData;
}
示例4: getRows
/**
* Returns Dynamic rows records configuration
*
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function getRows()
{
return ['record' => ['arguments' => ['data' => ['config' => ['componentType' => Container::NAME, 'isTemplate' => true, 'is_collection' => true, 'component' => 'Magento_Ui/js/dynamic-rows/record', 'dataScope' => '']]], 'children' => ['thumbnail_image_container' => $this->getColumn('thumbnail_image', __('Image'), ['fit' => true, 'formElement' => 'fileUploader', 'componentType' => 'fileUploader', 'component' => 'Magento_ConfigurableProduct/js/components/file-uploader', 'elementTmpl' => 'Magento_ConfigurableProduct/components/file-uploader', 'fileInputName' => 'image', 'isMultipleFiles' => false, 'links' => ['thumbnailUrl' => '${$.provider}:${$.parentScope}.thumbnail_image', 'thumbnail' => '${$.provider}:${$.parentScope}.thumbnail', 'smallImage' => '${$.provider}:${$.parentScope}.small_image'], 'uploaderConfig' => ['url' => $this->urlBuilder->addSessionParam()->getUrl('catalog/product_gallery/upload')], 'dataScope' => 'image'], ['elementTmpl' => 'ui/dynamic-rows/cells/thumbnail', 'fit' => true, 'sortOrder' => 0]), 'name_container' => $this->getColumn('name', __('Name'), [], ['dataScope' => 'product_link']), 'sku_container' => $this->getColumn('sku', __('SKU')), 'price_container' => $this->getColumn('price', __('Price'), ['imports' => ['addbefore' => '${$.provider}:${$.parentScope}.price_currency'], 'validation' => ['validate-zero-or-greater' => true]], ['dataScope' => 'price_string']), 'quantity_container' => $this->getColumn('quantity', __('Quantity'), ['dataScope' => 'qty'], ['dataScope' => 'qty']), 'price_weight' => $this->getColumn('weight', __('Weight')), 'status' => ['arguments' => ['data' => ['config' => ['componentType' => 'text', 'component' => 'Magento_Ui/js/form/element/abstract', 'template' => 'Magento_ConfigurableProduct/components/cell-status', 'label' => __('Status'), 'dataScope' => 'status']]]], 'attributes' => ['arguments' => ['data' => ['config' => ['componentType' => Form\Field::NAME, 'formElement' => Form\Element\Input::NAME, 'component' => 'Magento_Ui/js/form/element/text', 'elementTmpl' => 'ui/dynamic-rows/cells/text', 'dataType' => Form\Element\DataType\Text::NAME, 'label' => __('Attributes')]]]], 'actionsList' => ['arguments' => ['data' => ['config' => ['additionalClasses' => 'data-grid-actions-cell', 'componentType' => 'text', 'component' => 'Magento_Ui/js/form/element/abstract', 'template' => 'Magento_ConfigurableProduct/components/actions-list', 'label' => __('Actions'), 'fit' => true, 'dataScope' => 'status']]]]]]];
}