1
<admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>

How can I get the front Name of my admin, to use it in code like this ->

$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('add_variables' => false, 'add_widgets' => false, 'files_browser_window_url' => $this->getBaseUrl() . '(there must be frontname)/cms_wysiwyg_images/index/')); 

2 Answers 2

5

You can read directly from config file such as app/etc/local.xml with:

Mage::getConfig()

Thus you can use the following:

Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');

However, instead of doing this I reckon you should use the helper that lets you generate admin URLs:

Mage::helper("adminhtml")->getUrl("adminhtml/cms_wysiwyg_images/index/");
2
Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.