php - fuel cms before delete hook not working -


i want check dependency other table entry of module before deleting entry ..

so if no entry module exists allow delete else cant deleted

i have done following things : model name : jobs_model

class jobs_model extends base_module_model{     public $required = array('title');     public function __construct()     {         parent::__construct('fuel_jobs'); // table name     }     function tree($just_published = false)     {         return $this->_tree('foreign_keys');     }     public function on_before_delete($values)     {          print_r($values);          die();          return false;     }     } class job_model extends base_module_record {} 

config->hooks.php

$hook['before_delete_jobs'] = array(     'class' => 'job_hooks',     'function' => 'before_delete_jobs',     'filename' => 'job_hooks.php',     'filepath' => 'hooks',     'params' => array(),     'module' => 'job' ); 

hooks -> job_hooks.php

class job_hooks extends ci_controller {     public function __construct()     {         parent::__construct(); // table name     }     function before_delete_jobs($where)     {         print_r($where); return false;die(); //just prevent getting deleted implement thing later      } } 

but function did not executing or if executed have no effect mistake ??? or have other simple way please check


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -