/**
  * Composer for creating a new course
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $empty_link = new Link(['link' => "", 'name' => ""]);
     $empty_link->id = 0;
     \JavaScript::put(['links' => 0]);
     $view->with('empty_link', $empty_link);
     $view->with('categories', \Category::listCategories());
     $view->with('images', []);
     $view->with('videos', []);
     $view->with('ebooks', []);
     $view->with('links', []);
     $view->with('body', "");
 }
Example #2
0
 public function testListOneToManyRecursive()
 {
     $category = new Category(1);
     $this->assertEquals(array(3, 4, 5), $category->listCategories());
     $category_2 = new Category(2);
     $this->assertEquals(array(), $category_2->listCategories());
 }
 /**
  * Composer for listing all the categories
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->with('categories', \Category::listCategories());
 }