Update execution-pipeline.md

Corrected naming of SS_HTTPResponse variable. Improved readability of PHP code samples.
This commit is contained in:
Ryan Wachtl 2013-03-05 22:06:52 -06:00
parent 64888c07b7
commit 957f4e75e8

View File

@ -60,12 +60,12 @@ This will add an object with ID 12 to the cart.
When you create a function, you can access the ID like this: When you create a function, you can access the ID like this:
:::php :::php
public function addToCart ($request) { public function addToCart ($request) {
$param = $r->allParams(); $param = $request->allParams();
echo "my ID = ".$param["ID"]; echo "my ID = " . $param["ID"];
$obj = MyProduct::get()->byID($param["ID"]); $obj = MyProduct::get()->byID($param["ID"]);
$obj->addNow(); $obj->addNow();
} }
## Controllers and actions ## Controllers and actions
@ -79,10 +79,13 @@ You can access the following controller-method with /team/signup
class Team extends DataObject {} class Team extends DataObject {}
class Team_Controller extends Controller { class Team_Controller extends Controller {
static $allowed_actions = array('signup'); static $allowed_actions = array('signup');
public function signup($id, $otherId) {
return $this->renderWith('MyTemplate'); public function signup($id, $otherId) {
} return $this->renderWith('MyTemplate');
}
} }
## SSViewer template rendering ## SSViewer template rendering