· Contact
· Community
· Tutorial
· Documentation
· Download
· About
Learn :: View
<html>
<head>
<title>Test</title>
</head>
<body>
<?=$body;?>
</body>
</html>
namespace Controller;
use Spawn\View;
class Home extends \Spawn\Controller
{
//first action
public function indexAction()
{
$view = new View('home');
$view -> body = 'Hello View!';
$this -> response = $view->render();
}
}
Hello in index.phtml!
namespace Controller;
use Spawn\View;
class Home extends \Spawn\Controller
{
//first action
public function indexAction()
{
$view = new View('home');
// if name not isset, view use controller and action name
$view -> body = new View(); //Home/index
//View use __toString to call render()
$this -> response = $view;
}
}
namespace Controller;
class Home extends \Spawn\Controller\Template
{
public $tmp = 'home';
public function indexAction()
{
// $this -> view hava new View('home')
$this -> view -> body = new View();
}
}
Sitemap | Logos | License | Contact Us
Copyright © 2010 by Spawnm. All rights reserved