はい、これは少し奇妙であるが、それは以下に要約:
:
$this->getHtml('level-top')
ブロッククラスMage_Page_Block_Html_Topmenu
を指すコール内部の方法で($this
すると、そのクラスのインスタンスです)
public function getHtml($outermostClass = '', $childrenWrapClass = '')
{
Mage::dispatchEvent('page_block_html_topmenu_gethtml_before', array(
'menu' => $this->_menu,
'block' => $this
));
$this->_menu->setOutermostClass($outermostClass);
$this->_menu->setChildrenWrapClass($childrenWrapClass);
if ($renderer = $this->getChild('catalog.topnav.renderer')) {
$renderer->setMenuTree($this->_menu)->setChildrenWrapClass($childrenWrapClass);
$html = $renderer->toHtml();
} else {
$html = $this->_getHtml($this->_menu, $childrenWrapClass);
}
Mage::dispatchEvent('page_block_html_topmenu_gethtml_after', array(
'menu' => $this->_menu,
'html' => $html
));
return $html;
}
は
- >$outermostClass
あなたはへの呼び出しを参照してください。そこから値top-level
を保持しています$renderer
はMage_Page_Block_Html_Topmenu_Renderer
のインスタンスです。
protected function _toHtml()
{
$this->_addCacheTags();
$menuTree = $this->getMenuTree();
$childrenWrapClass = $this->getChildrenWrapClass();
if (!$this->getTemplate() || is_null($menuTree) || is_null($childrenWrapClass)) {
throw new Exception("Top-menu renderer isn't fully configured.");
}
$includeFilePath = realpath(Mage::getBaseDir('design') . DS . $this->getTemplateFile());
if (strpos($includeFilePath, realpath(Mage::getBaseDir('design'))) === 0 || $this->_getAllowSymlinks()) {
$this->_templateFile = $includeFilePath;
} else {
throw new Exception('Not valid template file:' . $this->_templateFile);
}
return $this->render($menuTree, $childrenWrapClass);
}
この方法は、今私の場合/vagrant/app/design/frontend/rwd/default/template/page/html/topmenu/renderer.phtml
(あなたが使用したテーマに応じて)で、$includeFilePath
変数にテンプレートファイルをロードします。
top-level
の値を持つ$outermostClass
の使用を見つけることができませんでした。