Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You may want to look over Varien/Router/Standard.php as well in particular:</p> <pre><code>/** * checking if this admin if yes then we don't use this router * * @return bool */ protected function _beforeModuleMatch() { if (Mage::app()-&gt;getStore()-&gt;isAdmin()) { return false; } return true; } </code></pre> <p>And this is called within the method <code>match(Zend_Controller_Request_Http $request)</code> as well as <code>collectRoutes($configArea, $useRouterName)</code> as <code>$useRouterName</code> will sometimes return <code>admin</code> and will also return <code>standard</code> for frontend requests. The assumption sounds correct as it all depends on how magento builds and stacks the <code>_routes</code> and <code>_modules</code> private array in this same class: <code>Mage_Core_Controller_Varien_Router_Standard</code>.</p> <p>I believe in this case you would want to specify the <code>&lt;use&gt;</code> node as <code>standard</code> for frontend and <code>admin</code> for admin, or rewrite the controller action in the <code>&lt;global&gt;</code> node.</p> <p>I think your best bet is to read over:</p> <ul> <li><a href="http://alanstorm.com/magento_dispatch_admin_cms_default_routers" rel="nofollow">http://alanstorm.com/magento_dispatch_admin_cms_default_routers</a></li> </ul> <p>and/or step through the logic with <a href="http://xdebug.org/" rel="nofollow">X-debug</a>.</p> <p>Even Alan Storm in his article writes how the same routers used for frontend and backend shouldn't be the same.</p> <blockquote> <p>So it looks like this method is here to ensure the Standard router object bails if, for some reason, the store model object thinks its in admin mode. Like the Standard/Admin router relationship, the store object is another one of those things that points to certain parts of the Magento development process being focused on the frontend application first, and then tacking on an admin console later and having to back-port changes.</p> <p>The store object is a model that really only applies to the frontend/cart application. However, because so much code in Magento assumes the store object exists, it needs to be available to the admin console application. This, in turn, creates trouble at the router level, which is what leads to a check like this. Many layers of abstraction, no defined contracts between classes/modules, and the fear of refactoring created by the lack of tests will always lead to these sorts of situations.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload