Welcome Guest, Not a member yet? Register   Sign In
call function without parameters
#1

[eluser]martin79[/eluser]
Hi Forum,

I am a bit confused setting up the structure of my app to be logical and
work fine with breadcrumps.

I have a controller, lets say
Code:
Country extends Controller{}
A country can have city tours, therefore I created a function
Code:
city_tours($tour){
if($tour=='some-tour'){...}
}

That will now create URLs like /country/city_tours/some-tour
If someone now just calls
Code:
/country/city_tours
I want to return a general view
about city tours or something like that.

But this now throws an "Missing argument" error, since the function
Code:
city_tours($tours){}
is expecting a parameter.

As far as I know PHP cannot overload functions and that wont let me create a function
Code:
city_tours()
.

Any ideas how to acomplish this? URL Rewrite?

Martin


Messages In This Thread
call function without parameters - by El Forum - 10-03-2008, 02:01 PM
call function without parameters - by El Forum - 10-03-2008, 02:31 PM
call function without parameters - by El Forum - 10-03-2008, 03:22 PM
call function without parameters - by El Forum - 10-03-2008, 04:25 PM
call function without parameters - by El Forum - 10-03-2008, 05:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB