{{block type="tag/popular" template="tag/popular.phtml"}}
blockDirective(): /magento/app/code/core/Mage/Core/Model/Email/Template/Filter.php at line 191
/**
* Retrieve Block html directive
*
* @param array $construction
* @return string
*/
public function blockDirective($construction)
{
$skipParams = array('type', 'id', 'output');
$blockParameters = $this->_getIncludeParameters($construction[2]);
$layout = Mage::app()->getLayout();
if (isset($blockParameters['type'])) {
$type = $blockParameters['type'];
$block = $layout->createBlock($type, null, $blockParameters);
} elseif (isset($blockParameters['id'])) {
$block = $layout->createBlock('cms/block');
if ($block) {
$block->setBlockId($blockParameters['id']);
}
}
if ($block) {
$block->setBlockParams($blockParameters);
foreach ($blockParameters as $k => $v) {
if (in_array($k, $skipParams)) {
continue;
}
$block->setDataUsingMethod($k, $v);
}
}
if (!$block) {
return '';
}
if (isset($blockParameters['output'])) {
$method = $blockParameters['output'];
}
if (!isset($method) || !is_string($method) || !is_callable(array($block, $method))) {
$method = 'toHtml';
}
return $block->$method();
}
blockDirective 方法会创建好对应的 block对象,并且调用对应的 toHtml 方法。
分享到:
相关推荐
magento中block应用 magento中block应用 magento中block应用
Block items can include any content that Magento CMS can involve Powerful block view scheduler Per-category and per-store view aheadWorks Market Segmentation Suite extension integration Enabling/...
magento数据结构分析 magento数据字典
magento的SMTP插件magento的SMTP插件magento的SMTP插件
magik shoes magento 模板, magento 1.7 模板
本文档通过一些实例详细讲述了Magento的MVC架构解析原理,通俗易懂,是有一定基础的Magento学习开发人员技能进阶的绝好文档。
深入理解Magento 由精东博客下载下来制作成pdf
Magento插件开发手册 Magento Extension Developers Guide
Athlete Magento主题,兼容Magento 1.9.x, 1.8.x, 1.7.x ,特点:完全自适应(响应式布局),自定义子主题,无限颜色,完全自定义,一键安装演示,小工具化横幅系统,颜色选择,MEGA菜单,多商店支持,自定义产品...
magento2 developers cookbook, magento 开发手册,magento教程
Magento Magento商城 Magento目录结构
Magento 2 Beginners Guide by Gabriel Guarino English | 14 Mar. 2017 | ASIN: B01MS81BQX | 442 Pages | AZW3 | 31.84 MB Key Features Set up and manage your very first online store with a friendly and ...
主要包括的内容有:magento的常用设置、Magento模板制作教程、Magento商城_目录结构说明、Magento中文教程实用文档、常用的xml的文件的作用以及自定义模块的应用
快速在服务器上复制为另一个站,版本用的是magento,php语言
Magento 的配置系统就像是 Magento 的心脏,支撑着 Magento 的运行。这套 配置系统掌管着几乎所有“module/model/class /template/etc”。它把整个 Magento 系统抽象出来,用一个配置文件来描述。这里的“配置文件”...
[Packt Publishing] Magento 扩展开发入门教程 (英文版) [Packt Publishing] Getting Started with Magento Extension Development (E-Book) ☆ 图书概要:☆ Understand Magento extensions, and build your own...
Magento 图片延时加载插件,用来解决网站速度慢或者图片数量多的问题
magento转移服务器magento建立多站点总结
Magento 模块开发教程 好家伙,值得拥有!