Questions tagged [codeigniter-hooks]

CodeIgniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files.

CodeIgniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files.

When CodeIgniter runs it follows a specific execution process, diagramed in the Application Flow page.

There may be instances, however, where you'd like to cause some action to take place at a particular stage in the execution process. For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trigger one of your own scripts in some other location.

Source: CodeIgniter

8 questions
5
votes
2 answers

How to retrieve the third uri segment in a codeigniter hook

I'm writing a custom post_controller hook. As we know, codeigniter uri structure is like this: example.com/class/function/id/ and my code: function hook_acl() { global $RTR; global $CI; $controller = $RTR->class; // the class part in…
Darren20
  • 90
  • 1
  • 7
2
votes
1 answer

Notification System in CodeIgniter

I've this forum sort of website which is already in place, now the client wants to implement notification system onto it. What's the optimum way out. My table typically looks like this at the moment: Id | to | from | Message | is_read | Time |…
1
vote
1 answer

CodeIgniter constant from hook in library

There is a problem. Using the CodeIgniter 3, i have a hook that is loaded in 'pre_controller' points and initializes language constant - SITELANG: define('SITELANG', $lang); How do i can access to this constant in the CodeIgniter library…
Marsick
  • 138
  • 1
  • 11
1
vote
1 answer

Is it possible to use libraries from hook Classes?

I'm using hooks to call a Class that is executed before controllers are called. $hook['pre_controller'] = array( 'class' => 'CargarInformacion', 'function' => 'obtenerInfo', 'filename' => 'CargarInformacion.php', 'filepath' =>…
laviku
  • 531
  • 12
  • 32
1
vote
1 answer

CodeIgniter profiler not catching inserts

I implemented a CodeIgniter hook to log all database transactions using the CI Profiler, as described here: CodeIgniter query log hook It works fine, but surprisingly it doesn't "catch" most of INSERT and UPDATE operations. In the log file I only…
luizs81
  • 397
  • 2
  • 12
0
votes
0 answers

Filter email id's before sending from codeigniter

I have to filter email id's before sending through Codeigniter's $this->email->to($userEmailIds); function. I have thinking to do like It is possible to do with Codeigniter's Hooks functionality. I am not sure because never used codeigniter hooks…
Nikunj Chotaliya
  • 802
  • 8
  • 19
0
votes
2 answers

CodeIgniter hook not catching insert/update queries

I am trying to use post_system or post_controller hook to catch and log all insert and update queries in a database table. But, what happens is that the $queries = $CI->db->queries; statement doesn't seem to catch any insert or update statement at…
Nadeem Khan
  • 3,408
  • 1
  • 30
  • 41
0
votes
1 answer

View loads offline, but NOT in the live site

Well, that's pretty weird... I uploaded my 100% working website to my server and it suddenly seems to have stopped working. To be specific : At the Home controller, everything goes smoothly but the $this->load->view( part seems to be ignored I've…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223