public function show(CourseRepositoryInterface $repo, SectionRepositoryInterface $sectionRepo, $subject_id, $course_id) { $course = $repo->find($course_id); $sections = $sectionRepo->all($course_id); $terms = []; foreach ($sections as $section) { if (!array_key_exists($section['term'], $terms)) { $terms[$section['term']] = ['id' => $section['term'], 'name' => term_name($section['term']), 'sections' => []]; } $terms[$section['term']]['sections'][] = $section; } array_set($course, 'sections', $sections); return $this->view->make('frontend.courses.show', ['course' => $course, 'single_page' => true, 'terms' => $terms, 'title' => sprintf('Which Course For Me | %s - %s', $course['id'], title_case($course['title']))]); }
function term_demo() { //Print demonstration term_font(); echo "DEMOnstration of PHPTerm for Unixs' terminals\n" . term_name() . ' - ' . term_color_name() . ' (' . term_shell() . ")\n\t\t\t\t<-Harvie 2oo7\n\n"; for ($i = 0; $i <= 8; $i++) { for ($x = 30; $x <= 37; $x++) { term_font($i, $x); echo "A"; } term_font(); for ($y = 40; $y <= 47; $y++) { term_font($y); echo "A"; for ($x = 30; $x <= 37; $x++) { term_font($i, $x); echo "A"; } } term_font(); echo "\n"; } term_font(); echo "\n"; }