• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hyphen in Controller Function Names?

#1
[eluser]Prophet[/eluser]
Hi all, the project I am working on at the moment needs to have "pretty" URLs. An example that is giving me grief is "/reports/stock-take". The way I have gone about this is by creating a function called stock-take() in my reports controller... But of course PHP doesn't like hyphens in function names.

How can I keep the hyphen in the URL and still call a separate stock_take() function?

#2
[eluser]John_Betong[/eluser]
[quote author="Prophet" date="1271434847"]Hi all, the project I am working on at the moment needs to have "pretty" URLs. An example that is giving me grief is "/reports/stock-take". The way I have gone about this is by creating a function called stock-take() in my reports controller... But of course PHP doesn't like hyphens in function names.

How can I keep the hyphen in the URL and still call a separate stock_take() function?[/quote]

Take a look at ./config/routes.php
 
 
 

#3
[eluser]Prophet[/eluser]
[quote author="John_Betong" date="1271436386"]Take a look at ./config/routes.php[/quote]

Thank you very much!

#4
[eluser]Aidy[/eluser]
I been using this, works brill..

http://ellislab.com/forums/viewthread/85901/#623512


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.