Certificated magento

3.6) How exactly can Magento define which physical file correspond to certain template/layout to use

 Magento uses the class Mage_Core_Model_Design_Package to find the exact file name of a template or layout file to use.

 
All the requests go through following method:
 
public function getFilename($file, array $params){
Varien_Profiler::start(__METHOD__);
$this->updateParamDefaults($params);
$result = $this->_fallback( $file,
  $params,
  $this->_fallback->getFallbackScheme(
  $params['_area'],
    $params['_package'],
    $params['_theme']
  )
);
Varien_Profiler::stop(__METHOD__);
return $result;
}
 
And the magic happens in the call to _fallback which looks for the specified filename, in different paths of the magento design folder. In a typical Magento store, the fallback list may be something as follows:
 
 
/app/design/frontend/<your package>/<your theme>/<some file>
/app/design/frontend/<your package>/defaulu/<some file>
/app/design/frontend/base/default/<some file>
 
This example is for a design file (like a template) but a similar list is used for a skin one.

0 Bình luận

Trở về
  • 1.12) Set up a cron job
  • 1.12) Set up a cron job

    Let’s start with server setup.   As any complex system, Magento has a lot of tasks that need to be executed...