Welcome Guest, Not a member yet? Register   Sign In
SOLVED: Can't Use "new" as function name?
#1

[eluser]Joakim_[/eluser]
Hi first let me say I'm a CL newbie and this might be a stupid question, but:


I try to create a function called called "new" but it wont work. When I change the name it works.

I couldn't find the word in the reserved words list. If it is reserved, can I use a different name for the URL? Let's say I create a function called new_item but I have the URL to say /new/?

Thank you a lot for your help! Smile
#2

[eluser]wiredesignz[/eluser]
Check PHP reserved words too
#3

[eluser]MrEnirO[/eluser]
Quote:Let’s say I create a function called new_item but I have the URL to say /new/?
You can use remap function: http://ellislab.com/codeigniter/user-gui...#remapping
#4

[eluser]Joakim_[/eluser]
Thank you a lot. I will check it out!
#5

[eluser]Michael Wales[/eluser]
URI Routing
#6

[eluser]xwero[/eluser]
No chance maning a function with the word new. I tried to do the same with do but i got no luck either.
php reserved words
#7

[eluser]Joakim_[/eluser]
[quote author="Michael Wales" date="1213369350"]URI Routing[/quote]

Awesome, thanks! That solved the problem! Smile

Code:
$route['items/new'] = "items/new_item";




Theme © iAndrew 2016 - Forum software by © MyBB