I am using a multidimensional array to hold the variables for a given page. I am trying to get a string from the url and match it with an array within my template array to pull the correct variables to display on the page.
Here is my array:
$template = array(
"index" => array(
"title" => "Dashboard",
"model" => "model/dash.php"
),
"input" => array(
"title" => "Dashboard",
"model" => "model/input.php"
),
"jobboard" => array(
"title" => "Job Board",
"model" => "model/job_board.php"
),
"jobcreate" => array(
"title" => "Job Creator",
"model" => "model/job_create.php"
)
);
And here is what I am using to try and verify the pages:
if(isset($_GET['page'])){ $page = $_GET['page']; }
if(in_array($page, $template)){
$title = $template[$page]['title'];
$model = $template[$page]['model'];
echo "yes";
}else{
$title = $template['index']['title'];
$model = $template['index']['model'];
echo "no";
}
The echo "yes/no";
is what I am using to debug if it is working or not but no matter what I have done it just keeps on outputting no.