Boilerplate Admin Controller

Updated . Posted . Visible to the public.
/**
 * Yourcompany.com
 *
 * PHP Version 5
 *
 * @category  Namespace
 * @package   Namespace_Module
 * @author    Your Name <your.name@yourcompany.com>
 * @copyright 2012 yourcompany.com
 * @license   http://www.yourcompany.com/license.txt Your license
 * @link      N/A
 */

/**
 * A description of the controller
 *
 * @category Namespace
 * @package  Namespace_Module
 * @author   Your Name <your.name@yourcompany.com>
 * @license  http://www.yourcompany.com/license.txt Your license
 * @link     N/A
 */
class Namespace_Module_Adminhtml_SomeController extends Mage_Adminhtml_Controller_Action
{
    /**
     * Control access to this controller via ACL
     *
     * @return bool
     */
    protected function _isAllowed()
    {
        return Mage::getSingleton('admin/session')->isAllowed('the/acl/xpath');
    }

    /**
     * Index action
     *
     * @return void
     */
    public function indexAction()
    {
        $this->_title($this->__('Module'))->_title($this->__('Something'));

        $this->loadLayout();
        $this->_setActiveMenu('namespace_module/something');
        $this->_addBreadcrumb(Mage::helper('namespace_module')->__('Module'), Mage::helper('namespace_module')->__('Something'));
        $this->renderLayout();
    }
}

Mike Whitby
Last edit
Posted by Mike Whitby to Magento (2012-02-29 15:41)