slug; } } if($section){ require_once 'section_'.$section.'.php'; } if(httpcode()==404){ $section_params = array(); $scripts = array(); $styles = array(); $section_content = ''; require_once 'section_404.php'; } if(isset($_POST['return']) && $_POST['return']=='json'){ header('Content-Type: application/json'); echo json_encode(['section'=>$section,'content'=>'
'.$section_content.'
','params'=>$section_params,'data'=>(isset($section_data)?$section_data:'')]); exit; }else{ header('Content-Type: text/html'); require_once $folder.'/templates.php'; $section_params['headers']=''; if(isset($section_params['styles'])){ foreach($section_params['styles'] as $link){ if($link!=''){ $section_params['headers'].=''; } } } if(isset($section_params['scripts'])){ foreach($section_params['scripts'] as $link){ if($link!=''){ # $section_params['headers'].=''; $section_params['headers'].=''; } } } $content = '
'.$section_content.'
'.(isset($section_call_script)?'':''); echo template($section_params,$content); } function httpcode($code = false){ if($code==false){ return http_response_code(); }else{ http_response_code($code); } }