//Array of configuration views
$config_template = array(
'default' => 'view/home.php' ,
'chapter-name' => 'view/chapter.php' ,
'marker-name' => 'view/marker.php' ,
) ;
//Logic to call template
$include = $config_template['default'] ;
if ( isset( $_GET['chapter'] ) && array_key_exists( strtolower( $_GET['chapter'] ) , $config_template ) ) {
$include = $config_template[$_GET['chapter']] ;
}
else if ( isset( $_GET['marker'] ) && array_key_exists( strtolower( $_GET['marker'] ) , $config_template ) ) {
$include = $config_template[$_GET['marker']] ;
}
//include template
include_once($include) ;
This way the code is ready to grow up...