Controllers accept control of a request (from the browser) from the application. The Application operates at the root of the web structure and interprets the request to instatiate a controller request and execute a method of the controller
http://localhost/example/hello
<?php
class example extends Controller {
function hello() {
print 'hello';
}
}
Up to two parameters can be passed
http://localhost/example/hello/john/citizen
<?php
class example extends Controller {
function hello( $p1, $p2) {
printf( 'hello : %s, %s', $p1, $p2;
}
}
$url = filter_var( $this->url, FILTER_SANITIZE_URL);
,
so again it has to be fairly simple - periods [.] for instance are stripped out. POST and GET via parameters (http://req/?v=1
)
are the most flexible ways to pass information.