0

I have a function named enable_disable(param1,param2) in my_helper.php.

How can I call this enable_disable(param1,param2) from routes.php in codeigniter?

Please share your great ideas if anyone have the key.

Marco Salerno
  • 5,131
  • 2
  • 12
  • 32
Raham
  • 4,781
  • 3
  • 24
  • 27
  • why would you want that in routes.php? – LogicBlower Aug 18 '17 at 10:51
  • @LogicBlower dear I have a function which is common in all the controller(s).Actually I want to put that in helper and called it from routes.php by passing two param i.e. table_name and status. – Raham Aug 22 '17 at 11:55

1 Answers1

0

Write that code (enable_disable($p1, $p2) function) in pre_system hook. It is being loaded before router. If you want quick and dirty way, you can put it into APPPATH.'config/config.php' file at the end.

Tpojka
  • 6,996
  • 2
  • 29
  • 39