Welcome Guest, Not a member yet? Register   Sign In
How does it know which page to load?
#4

First 2 segments in a url are controller/method, respectively, unless overridden by a route.
Any additional segments get passed to the method as individual parameters.


if the url was: index.php/pages/view (pages=controller, view=method), there are no additional parameters sent, so it uses the default which is hardcoded to 'home' here:
public function view($page = 'home')

if the url was: index.php/pages/view/products (pages=controller, view=method, products=first parameter)
then $page becomes "products" here because the parameter was sent:
public function view($page = 'home')
Reply


Messages In This Thread
RE: How does it know which page to load? - by CroNiX - 03-05-2015, 02:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB