public function action_index() { // Load the user information // $user = Auth::instance()->get_user(); $config = array('author' => 'Shanmugan', 'title' => 'Test', 'subject' => 'Pdf', 'name' => Text::random() . '.pdf'); $name = "Shan"; View_PDF::factory('welcome/info', $config)->set("name", $name)->render(); $this->template->content = View::factory('welcome/info')->bind('name', $name); // if a user is not logged in, redirect to login page // if (!$user) { // $this->redirect('welcome/login'); // } }
public function test_dompdf_returns_instance() { self::$expect_dompdf_presence = TRUE; $view = View_PDF::factory('exists'); $this->assertInstanceOf('DOMPDF', $view->dompdf()); }