本文整理匯總了PHP中Magento\Framework\View\Element\Template::toHtml方法的典型用法代碼示例。如果您正苦於以下問題:PHP Template::toHtml方法的具體用法?PHP Template::toHtml怎麽用?PHP Template::toHtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\Element\Template
的用法示例。
在下文中一共展示了Template::toHtml方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testToHtml
/**
* @covers \Magento\Framework\View\Element\AbstractBlock::toHtml
* @see testAssign()
*/
public function testToHtml()
{
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('any area');
$this->assertEmpty($this->_block->toHtml());
$this->_block->setTemplate(uniqid('invalid_filename.phtml'));
$this->assertEmpty($this->_block->toHtml());
}
示例2: toHtml
/**
* {@inheritdoc}
*/
public function toHtml()
{
if ($this->customerSession->isLoggedIn() || !$this->registration->isAllowed() || !$this->accountManagement->isEmailAvailable($this->getEmailAddress()) || !$this->validateAddresses()) {
return '';
}
return parent::toHtml();
}
示例3: toHtml
public function toHtml()
{
if (!$this->getAddThisEnabled() || !$this->getAddThisPubId()) {
return '';
}
return parent::toHtml();
}
示例4: toHtml
/**
* {@inheritdoc}
*/
public function toHtml()
{
$isAutomaticAccount = $this->coreRegistry->registry('automatic_account');
if (!$isAutomaticAccount) {
return '';
}
return parent::toHtml();
}
示例5: _initializeRedirectTemplateWithMark
/**
* Initializes redirect template and set mark
* @param Template $mark
*
* @return void
*/
protected function _initializeRedirectTemplateWithMark(Template $mark)
{
$this->setTemplate('Magento_Paypal::payment/redirect.phtml')->setRedirectMessage(__('You will be redirected to the PayPal website when you place an order.'))->setMethodTitle('')->setMethodLabelAfterHtml($mark->toHtml());
}