Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Onepage Class Reference
Inheritance diagram for Onepage:
Template AbstractBlock DataObject BlockInterface

Public Member Functions

 __construct (\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Data\Form\FormKey $formKey, \Magento\Checkout\Model\CompositeConfigProvider $configProvider, array $layoutProcessors=[], array $data=[], \Magento\Framework\Serialize\Serializer\Json $serializer=null)
 
 getJsLayout ()
 
 getFormKey ()
 
 getCheckoutConfig ()
 
 getBaseUrl ()
 
 getSerializedCheckoutConfig ()
 
- Public Member Functions inherited from Template
 __construct (Template\Context $context, array $data=[])
 
 setTemplateContext ($templateContext)
 
 getTemplate ()
 
 setTemplate ($template)
 
 getTemplateFile ($template=null)
 
 getArea ()
 
 assign ($key, $value=null)
 
 fetchView ($fileName)
 
 getBaseUrl ()
 
 getObjectData (\Magento\Framework\DataObject $object, $key)
 
 getCacheKeyInfo ()
 
- Public Member Functions inherited from AbstractBlock
 __construct (\Magento\Framework\View\Element\Context $context, array $data=[])
 
 getJsLayout ()
 
 getRequest ()
 
 getParentBlock ()
 
 setLayout (\Magento\Framework\View\LayoutInterface $layout)
 
 getLayout ()
 
 setNameInLayout ($name)
 
 getChildNames ()
 
 setAttribute ($name, $value=null)
 
 setChild ($alias, $block)
 
 addChild ($alias, $block, $data=[])
 
 unsetChild ($alias)
 
 unsetCallChild ($alias, $callback, $result, $params)
 
 unsetChildren ()
 
 getChildBlock ($alias)
 
 getChildHtml ($alias='', $useCache=true)
 
 getChildChildHtml ($alias, $childChildAlias='', $useCache=true)
 
 getBlockHtml ($name)
 
 insert ($element, $siblingName=0, $after=true, $alias='')
 
 append ($element, $alias='')
 
 getGroupChildNames ($groupName)
 
 getChildData ($alias, $key='')
 
 getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getUrl ($route='', $params=[])
 
 getViewFileUrl ($fileId, array $params=[])
 
 formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
 
 formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false)
 
 getModuleName ()
 
 escapeHtml ($data, $allowedTags=null)
 
 escapeJs ($string)
 
 escapeHtmlAttr ($string, $escapeSingleQuote=true)
 
 escapeCss ($string)
 
 stripTags ($data, $allowableTags=null, $allowHtmlEntities=false)
 
 escapeUrl ($string)
 
 escapeXssInUrl ($data)
 
 escapeQuote ($data, $addSlashes=false)
 
 escapeJsQuote ($data, $quote='\'')
 
 getNameInLayout ()
 
 getCacheKeyInfo ()
 
 getCacheKey ()
 
 getVar ($name, $module=null)
 
 isScopePrivate ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from BlockInterface
 toHtml ()
 

Protected Attributes

 $formKey
 
 $_isScopePrivate = false
 
 $jsLayout
 
 $configProvider
 
 $layoutProcessors
 
- Protected Attributes inherited from Template
 $_viewVars = []
 
 $_baseUrl
 
 $_jsUrl
 
 $_allowSymlinks
 
 $_filesystem
 
 $_template
 
 $templateEnginePool
 
 $_storeManager
 
 $_appState
 
 $directory
 
 $templateContext
 
 $pageConfig
 
 $resolver
 
 $validator
 
- Protected Attributes inherited from AbstractBlock
 $_design
 
 $_session
 
 $_sidResolver
 
 $_nameInLayout
 
 $_layout
 
 $jsLayout = []
 
 $_request
 
 $_urlBuilder
 
 $_eventManager
 
 $_frontController
 
 $_assetRepo
 
 $_viewConfig
 
 $_cacheState
 
 $_logger
 
 $_escaper
 
 $filterManager
 
 $_localeDate
 
 $inlineTranslation
 
 $_isScopePrivate = false
 
 $_scopeConfig
 
 $_cache
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractBlock
static extractModuleName ($className)
 
- Data Fields inherited from Template
const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink'
 
- Data Fields inherited from AbstractBlock
const CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER
 
const CACHE_KEY_PREFIX = 'BLOCK_'
 
- Protected Member Functions inherited from Template
 _construct ()
 
 _toHtml ()
 
 getRootDirectory ()
 
 getMediaDirectory ()
 
- Protected Member Functions inherited from AbstractBlock
 _construct ()
 
 _prepareLayout ()
 
 _beforeToHtml ()
 
 _afterToHtml ($html)
 
 _toHtml ()
 
 _getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound'])
 
 getCacheTags ()
 
 getCacheLifetime ()
 
 _loadCache ()
 
 _saveCache ($data)
 
 _getSidPlaceholder ($cacheKey=null)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Onepage checkout block @api @SuppressWarnings(PHPMD.CouplingBetweenObjects)

Since
100.0.2

Definition at line 14 of file Onepage.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\View\Element\Template\Context  $context,
\Magento\Framework\Data\Form\FormKey  $formKey,
\Magento\Checkout\Model\CompositeConfigProvider  $configProvider,
array  $layoutProcessors = [],
array  $data = [],
\Magento\Framework\Serialize\Serializer\Json  $serializer = null 
)
Parameters
\Magento\Framework\View\Element\Template\Context$context
\Magento\Framework\Data\Form\FormKey$formKey
\Magento\Checkout\Model\CompositeConfigProvider$configProvider
array$layoutProcessors
array$data
\Magento\Framework\Serialize\Serializer\Json | null$serializer
Exceptions

Definition at line 55 of file Onepage.php.

62  {
63  parent::__construct($context, $data);
64  $this->formKey = $formKey;
65  $this->_isScopePrivate = true;
66  $this->jsLayout = isset($data['jsLayout']) && is_array($data['jsLayout']) ? $data['jsLayout'] : [];
67  $this->configProvider = $configProvider;
68  $this->layoutProcessors = $layoutProcessors;
69  $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
70  ->get(\Magento\Framework\Serialize\Serializer\Json::class);
71  }

Member Function Documentation

◆ getBaseUrl()

getBaseUrl ( )

Get base url for block.

Returns
string @codeCoverageIgnore

Definition at line 113 of file Onepage.php.

114  {
115  return $this->_storeManager->getStore()->getBaseUrl();
116  }

◆ getCheckoutConfig()

getCheckoutConfig ( )

Retrieve checkout configuration

Returns
array @codeCoverageIgnore

Definition at line 102 of file Onepage.php.

103  {
104  return $this->configProvider->getConfig();
105  }

◆ getFormKey()

getFormKey ( )

Retrieve form key

Returns
string @codeCoverageIgnore

Definition at line 91 of file Onepage.php.

92  {
93  return $this->formKey->getFormKey();
94  }

◆ getJsLayout()

getJsLayout ( )
Returns
string

Definition at line 76 of file Onepage.php.

77  {
78  foreach ($this->layoutProcessors as $processor) {
79  $this->jsLayout = $processor->process($this->jsLayout);
80  }
81 
82  return json_encode($this->jsLayout, JSON_HEX_TAG);
83  }
$processor
Definition: 404.php:10

◆ getSerializedCheckoutConfig()

getSerializedCheckoutConfig ( )
Returns
bool|string
Since
100.2.0

Definition at line 122 of file Onepage.php.

123  {
124  return json_encode($this->getCheckoutConfig(), JSON_HEX_TAG);
125  }

Field Documentation

◆ $_isScopePrivate

$_isScopePrivate = false
protected

Definition at line 24 of file Onepage.php.

◆ $configProvider

$configProvider
protected

Definition at line 34 of file Onepage.php.

◆ $formKey

$formKey
protected

Definition at line 19 of file Onepage.php.

◆ $jsLayout

$jsLayout
protected

Definition at line 29 of file Onepage.php.

◆ $layoutProcessors

$layoutProcessors
protected

Definition at line 39 of file Onepage.php.


The documentation for this class was generated from the following file: