Jump to content

Call Util , Configuration methods in a function of AdminController


jbastarras

Recommended Posts

I have a class like this 

 

class AdminOrdersController extends AdmiOrdersControllerCore {
 
public function __construct()
{
 
try {
$accion = $_GET['action'] ;
 
if ($_GET['action']=='validar'){
$this->yourexamplefunction();
}else{
parent::__construct();
$this->_conf = $this->_conf + array(32 => $this->l('text.'));
}
 
}catch(Exception $e){
 
}
parent::__construct();
$this->_conf = $this->_conf + array(32 => $this->l('text'));
 
 
}
 
 
And the function 
 
 
public function yourexamplefunction(){
 
$result = Db::getInstance()->execute('
SELECT id_order
FROM '._DB_PREFIX_.'orders where mark IS NULL 
');
 
 
$module_name = self::config('app')['module_name'];
 
die($module_name );
 
 
And prestashop show me this error 
 
Call to undefined method AdminOrdersController::config() in C:\develop\prestashop\override\controllers\admin\AdminOrdersController.php on line 231
 
 
Why? How include Controllers in my function ? 
Edited by jbastarras (see edit history)
Link to comment
Share on other sites

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...