I am creatting a Code Igniter project in which I want to pass a variable through the URL like a get statement, like this:
url: /site/cake/1
controller function: cake($var)
but when the variable is left blank, I receive an error, how can I get code igniter, to ignore this?
I am creatting a Code Igniter project in which I want to pass a
Share
In your controller, do this:
When
$varisn’t present in the URL, it will be set tonulland you’ll receive no error.