For this in the admin panel /brands/adminhtml_brand/new/ for my custom module, I am supposed to be seeing a page when I want to add a new entry to the database. I am following this tutorial. And my layout.xml is setup correctly.

BrandController.php
class Desbest_Brands_Adminhtml_BrandController extends Mage_Adminhtml_Controller_Action
public function editAction()
{
$id = $this->getRequest()->getParam('id', null);
$model = Mage::getModel('brands/example');
if ($id) {
$model->load((int) $id);
if ($model->getId()) {
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
if ($data) {
$model->setData($data)->setId($id);
}
} else {
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('brands')->__('Example does not exist'));
$this->_redirect('*/*/');
}
}
Mage::register('example_data', $model);
$this->loadLayout();
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
$this->renderLayout();
}
}
Edit.php
<?php
class Desbest_Brands_Block_Adminhtml_Example_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
parent::__construct();
$this->_objectId = 'id';
$this->_blockGroup = 'brands';
$this->_controller = 'adminhtml_example';
$this->_mode = 'edit';
$this->_addButton('save_and_continue', array(
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save',
), -100);
$this->_updateButton('save', 'label', Mage::helper('brands')->__('Save Example'));
$this->_formScripts[] = "
function toggleEditor() {
if (tinyMCE.getInstanceById('form_content') == null) {
tinyMCE.execCommand('mceAddControl', false, 'edit_form');
} else {
tinyMCE.execCommand('mceRemoveControl', false, 'edit_form');
}
}
function saveAndContinueEdit(){
editForm.submit($('edit_form').action+'back/edit/');
}
";
}
public function getHeaderText()
{
if (Mage::registry('example_data') && Mage::registry('example_data')->getId())
{
return Mage::helper('brands')->__('Edit Example "%s"', $this->htmlEscape(Mage::registry('example_data')->getName()));
} else {
return Mage::helper('brands')->__('New Example');
}
}
}
Grid.php
<?php
class Desbest_Brands_Block_Adminhtml_Example_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function __construct()
{
parent::__construct();
$this->setId('example_grid');
$this->setDefaultSort('id');
$this->setDefaultDir('desc');
$this->setSaveParametersInSession(true);
}
protected function _prepareCollection()
{
$collection = Mage::getModel('brands/example')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('id', array(
'header' => Mage::helper('brands')->__('ID'),
'align' =>'right',
'width' => '50px',
'index' => 'id',
));
$this->addColumn('attributelabelid', array(
'header' => Mage::helper('brands')->__('Name'),
'align' =>'left',
'index' => 'name',
));
$this->addColumn('name', array(
'header' => Mage::helper('brands')->__('Description'),
'align' =>'left',
Based on the URL you’re attempting to access, your controller action should be
newAction(), noteditAction(), unless you already have newAction() forwarding to edit as in the tutorial.The tutorial you linked to included a forward from the newAction to the editAction, using this:
So, either make sure that you’re using that forward, or access the controller at
/brands/adminhtml_brand/edit/instead, and if you do this, be sure to update your layout handle to target the edit route.Some things to do to troubleshoot: