Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?php class Front_Cart_ViewSuccessView extends AhamFrontBaseView { public function executeHtml(AgaviRequestDataHolder $rd) { $this->setupHtml($rd); $order = array(); if ($order_id = $rd->getCookie("order_id")) $order = $this->getContext()->getModel('Cart', 'Front')->getShoppingCartById($order_id); $order["items"] = $this->getContext()->getModel('Cart', 'Front')->getItems($order_id); $this->setAttribute("order", $order); foreach ($order["items"] as $key => $item) { $rdh = new AgaviRequestDataHolder(); $rdh->setParameters(array("item" => $item)); $container = $this->getContext()->getController()->createExecutionContainer('Front', 'Cart.' . ucfirst($item["type"]) . '.Item' , $rdh, 'html'); $container->execute(); $order["items"][$key]["body"] = $container->getResponse()->getContent(); } //$this->getContext()->getModel('Cart', 'Front')->getItems(); } public function executeJson(AgaviRequestDataHolder $rd) { return json_encode(); } } ?>
This paste will be private.
From the Design Piracy series on my blog: