Jump to content

a ModuleAdminController problem


jemmeli

Recommended Posts

hello everybody:

 

i have a ModuleAdmin controller costumized to show me table database list with action of edit and delete with the help of views helper .

 

the controller show me the result of database record with the action of delete and edit in each rcord but the problem is when i click the button "add new" the page redirected to a page of error telling me that the Class 'BlockPerso' not found .but when i copy my module model file named blockPerso into the directrory of admin/classes/controller it work , i want to do it automatically because i am developping a module and i dont want manually things:

 

this is the code of my ModuleAdminController

 




class AdminBlockPersoController extends ModuleAdminController {

public function __construct() {

	$this->table = 'blockpersoadmintexture';
	$this->className = 'BlockPerso';
	$this->lang = false;

	//View Helpers dans le constructeur
	$this->fields_list = array(
		'id_blockpersoadmintexture' => array(
			'title' => '#'
		),
		'id_product' => array(
			'title' => 'id_produit'
		),
		'reference' => array(
			'title' => 'Réf'
		),
		'nom' => array(
			'title' => 'Nom'
		),
		'description' => array(
			'title' => 'Description'
		)
	); /* end of fields_list */


	// This adds a multiple deletion button
	$this->bulk_actions = array(
		'delete' => array(
			'text' => $this->l('Delete selected'),
			'confirm' => $this->l('Delete selected items?')
		)
	);

	parent::__construct();

	//$this->actions = array('delete');
}

// This method generates the list of results
public function renderList() {
	// Adds an Edit button for each result
	$this->addRowAction('edit');

	// Adds a Delete button for each result
	$this->addRowAction('delete');

	return parent::renderList();
}

// This method generates the Add/Edit form
public function renderForm() {
	// Building the Add/Edit form
	$this->fields_form = array(
		'legend' => array(
			'title' => $this->l('Test')
		),
		'input' => array(
			array(
				'type' => 'text',
				'label' => $this->l('name test:'),
				'name' => 'name',
				'size' => 33,
				'required' => true,
				'desc' => $this->l('A description'),
			)
		),
		'submit' => array(
			'title' => $this->l('	Save   '),
			'class' => 'button'
		)
	);

	return parent::renderForm();
}

}
}


and think you very much for the help in advance

Edited by jemmeli (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...