loadTemplate('public/cv'); $cv_sec = [ "short" , "grants", "responsabilities", "outreach" ]; $cv_rst = array(); $parser = new Doctrine\RST\Parser(); foreach ($cv_sec as $sec) { $fname = "{$cwd}/cv/{$sec}.rst"; $handle = fopen($fname, "r"); $cv_rst[$sec] = $parser->parse(fread($handle, filesize($fname)))->render(); fclose($handle); } $cv_rst['ROOT_URL'] = $iap_root; $cv_rst['title'] = 'Guilhem Lavaux\'s CV'; header('Content-Type: text/html; charset=utf-8'); echo $tpl->render($cv_rst);