저는 초보자이지만 자제하고 가능한 한 빨리 배우려고합니다. 내가 겪고 있었 :magento, 기본 제품을 이해하는 데 도움이됩니다. 템플릿 코드
이파일이 : 응용 프로그램이/디자인/프론트 엔드가 /베이스/기본/템플릿/카탈로그/제품/list.phtml가 포함
<?php $_productCollection=$this->getLoadedProductCollection() ?> <?php if(!$_productCollection->count()): ?> <div class="note-msg">
<?php echo $this->__("There are no products matching the selection.") ?> </div>
<?php else: ?>
getLoadedProductCollection 방법은 다음에서 찾을 수 있다고 http://alanstorm.com/layouts_blocks_and_templates을 템플릿의 블록, Mage_Catalog_Block_Product_List ... 그리고 거기에서 :
파일 : 응용 프로그램/코드/코어/마법사/카탈로그/블록/제품/List.php
...
public function getLoadedProductCollection()
{
return $this->_getProductCollection();
}
...
그 후, 앞서 언급 한 페이지는 다음과 같이 씁니다. 블록의 _getProductCollection은 모델을 인스턴스화하고 데이터를 읽고 결과를 템플릿에 반환합니다.
저는 여기를 잃었습니다.
if (is_null($this->_productCollection))
1) _productCollection가 보호 변수 $ _productCollection을 뜻 : _getProductCollection()이 라인을 가지고?
if (is_null($this->_productCollection)) {
$layer = $this->getLayer();
2) $ layer = $ this-> getLayer() plz에 대한 설명은 무엇입니까? 그 후
내가 얻을 :
if ($this->getShowRootCategory()) {
$this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
}
3) 어디 방법 getShowRootCategory은()?
$this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
5) 내 질문이 많은 것에 너무 쉽게 들릴 수도 : 나 라인의 장단점을 이해하는 데 도움이 어떤 방식
4). 그러나 모든 온라인 리소스를 참조하여 이러한 모든 것들과 다른 것들을 Magento의 초보자로서 배울 수 있습니까?
행운이
#Anton, ".. 또는 소스 코드에서 궁금한 방법을 찾으십시오." 나는 나의 질문을 물었다. 3 그 이유는 .. – coder
@coder와 내 grep 예제는 파일, 라인, 메소드 또는 당신이 여기에서 이해하지 못했던 부분을 보여줍니까? –