一个名为top.phtml的文件里所有的代码如下:<div class="menu">
<div class="menu2">
<div class="indent">
<h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
<ul id="nav">
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>
<div class="clear"></div>
</div>
</div>
</div>
我现在的疑惑是,该文件并没有包含任何其他目录下的css和php文件
1,class调用的是哪里文件的类型???
2,$this调用哪里的方法???它不是只能调用本类声明的方法??帮下忙,谢谢大家。
<div class="menu2">
<div class="indent">
<h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
<ul id="nav">
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>
<div class="clear"></div>
</div>
</div>
</div>
我现在的疑惑是,该文件并没有包含任何其他目录下的css和php文件
1,class调用的是哪里文件的类型???
2,$this调用哪里的方法???它不是只能调用本类声明的方法??帮下忙,谢谢大家。
完整代码如下:
<?php/**
* templatemonster.com
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @category design_theme001
* @package TM
* @copyright Copyright (c) 2008 templatemonster.com (http://www.templatemonster.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/?><?php /** * Top menu for store * * @see Mage_Catalog_Block_Navigation */?><div class="menu"> <div class="menu2"> <div class="indent"> <h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4> <ul id="nav"> <?php foreach ($this->getStoreCategories() as $_category): ?> <?php echo $this->drawItem($_category) ?> <?php endforeach ?> </ul> <div class="clear"></div> </div> </div></div> <?php //echo $this->getChildHtml('topLeftLinks') ?>
<reference name="top.menu"> <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/> </reference>不明白,这样是怎么能调用到php代码里的方法的
而且方法在哪个文件都没搞明白
流程是不是这样:
php调用--》xml-->再执行xml所包含的phtml文件调用的程序使用$this的解释就是:$this其实就是调用的php里的类方法是这样的吧???
echo print_r(get_class_methods(get_class( $this )));
没法运行phtml文件阿。没法下手了
$this不是这个类的对象名,echo print_r(get_class_methods(get_class( $this )))这个代码肯定运行不了的,
源码不全无法解释