getChildHtml('breadcrumbs') ?>
getChildHtml('global_messages') ?>
getChildHtml('content') ?>
游戏公社招商宣传片拍摄文案.doc游戏公社招商宣传片拍摄文案.doc 深入理解Magento – 第三章 – 布局,块和模板 深入理解Magento 作者:Alan Storm 翻译:Hailong Zhang 第三章 – 布局,块和模板 我们接着研究Magento。根据我们第二章讲的Magento MVC的架构,我们接下来应该讲模型(Model),但是我们跳过模型先来看布局和块。和一些流行的PHP MVC架构不同的是,Magento的执行控制器不直接将数据传给试图,相反的视图将直接引用模型,从模型取数据。这样的设计就导致了视图被拆分成...
__('There are no products matching the selection.') ?>
这里“getLoadedProductCollection”方法可以在这个模板的块对象 “Mage_Catalog_Block_Product_List”中找到 File: app/code/core/Mage/Catalog/Block/Product/List.php ... public function getLoadedProductCollection() { return $this->_getProductCollection(); } ... 块的“_getProductCollection”方法会实例化模型,并读取数据然后返回给模板。 嵌套块 Magento把视图分离成块和模板的真正强大之处在于“getChildHtml”方法。这个方法可以让你实现在块中嵌套块的功能。顶层的块调用 第二层的块,然后是第三层……这就是Magento如何输出HTML的。让我们来看一下单列的顶层模板 File: app/design/frontend/base/default/template/page/1column.phtml getLang() ?>" lang="getLang() ?>"> getChildHtml('head') ?> getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>> getChildHtml('after_body_start') ?>