Example #1
0
 public function testViewCreateMethod()
 {
     $data = ['foo' => 'Cygnite!'];
     $content = View::create("fixtures.hello", $data);
     $this->assertEquals('Hello Cygnite!', Response::make($content)->getContent());
     $data = ['foo' => 'Foo Bar!'];
     $composeContent = View::compose("fixtures.hello", $data);
     $this->assertEquals('Hello Foo Bar!', Response::make($composeContent)->getContent());
 }
Example #2
0
 public function testViewCreateMethod()
 {
     $app = new \Cygnite\Foundation\Application();
     ViewFactory::setApplication($app);
     $data = ['foo' => 'Cygnite!'];
     $content = View::create('fixtures.hello', $data);
     $this->assertEquals('Hello Cygnite!', Response::make($content)->getContent());
     $data = ['foo' => 'Foo Bar!'];
     $composeContent = View::compose('fixtures.hello', $data);
     $this->assertEquals('Hello Foo Bar!', Response::make($composeContent)->getContent());
 }
 /**
  *  Display product details
  * @param type $id
  */
 public function showAction($id)
 {
     $product = Product::find($id);
     $content = View::create('Apps.Views.product.show', ['record' => $product, 'title' => 'Show the Product']);
     return Response::make($content);
 }
 /**
  * Default method for your controller. Render welcome page to user.
  * @access public
  *
  */
 public function indexAction()
 {
     $content = View::create('Apps.Views.home.welcome', ['title' => 'Welcome to Cygnite Framework']);
     return Response::make($content);
 }