2013-01-04 21 views

回答

1

爲方便起見提供方法鏈接。

  1. Mage::run('','store')
  2. Mage_Core_Model_App::run(array(array('scope_code'=>'','scope_type'=>'store')))
  3. Mage_Core_Model_App::_initCurrentStore('','store')
  4. Mage_Core_Model_App::_initStores('','store')

_initStores()loop which iterates over the core_store collection。該循環包含一個測試,以查看App實例的_store屬性是否已設置,如果未設置,則將其設置爲當前集合成員,如果該成員的主鍵值爲真。換句話說,儘管管理商店是集合中的第一個項目,因爲它的ID是0,所以將使用而不是

+0

哇真棒...非常感謝你的好意,你的詳細答案真的幫了我很多。現在我知道Magento如何設置商店視圖。我希望人們閱讀這篇文章也有幫助。 :d – Wakanina

0

這將是index.php文件

/* Store or website code */ 
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; 

/* Run store or run website */ 
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; 

Mage::run($mageRunCode, $mageRunType); 

得到它是如何從究竟這個涼爽的博客文章http://blog.belvg.com/magento-certified-developer-exam-module-initialization.html覆蓋你需要了解這一切做的更多細節。

+0

謝謝。但我認爲,必須有一個核心功能應該做到這一點。它通過良性解釋得很好。 :) – Wakanina

+0

是啊好吧本剛給你帶來了我發佈的鏈接的內容 –