· Contact
· Community
· Tutorial
· Documentation
· Download
· About
Learn :: Controller
<?php
//namespace name
namespace Controller;
//controller name
class Home extends \Spawn\Controller
{
//first action
public function indexAction()
{
$this -> response = 'Hello World!';
}
}
<?php
namespace Controller;
//controller name
class Home extends \Spawn\Controller
{
//first action
public function indexAction()
{
$this -> response = 'Hello World!';
}
//next action
public function testAction()
{
$this -> response = 'test!';
}
}
<?php
namespace Controller;
//controller name
class Home extends \Spawn\Controller
{
public function init()
{
//'I am init() method and I\'m start before action :-)';
$this -> method = new \Model\Foo();
}
//first action
public function indexAction()
{
$this -> response = 'Hello World!';
}
//next action
public function testAction()
{
$this -> response = 'test!';
}
public function end()
{
$this -> method -> bar();
}
}
//line 31,32 $spawn -> controller = 'Spawn'; $spawn -> action = 'index';
Sitemap | Logos | License | Contact Us
Copyright © 2010 by Spawnm. All rights reserved