Skip to content

Commit

Permalink
Updated example to use Http/Request and Http/Response
Browse files Browse the repository at this point in the history
  • Loading branch information
mekwall committed May 31, 2011
1 parent 402dd90 commit e40ee68
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 8 additions & 3 deletions examples/blog/app/Views/Article.php
@@ -1,15 +1,20 @@
<?php
namespace Blog\Views;

use Milk\Views\BaseView;
use Milk\Views\BaseView,
Milk\IO\Http;

use Blog\Models\Article as Model;

class Article extends BaseView {

public static function read() {
public static function read(Http\Request $request) {
$article = new Model;
return "<pre>".var_export($article, true)."</pre>";

$response = new Http\Response;
$response->setContent("<pre>".var_export($article, true)."</pre>");

return $response;
}

}
2 changes: 1 addition & 1 deletion examples/blog/app/_init.php
Expand Up @@ -15,7 +15,7 @@
// Let's do some magic chaining
$app
->config
->setGroup('production')
->setGroup('stage')
->app() // Return to app instance
// Add current namespace to loader
->loader
Expand Down
8 changes: 5 additions & 3 deletions examples/blog/app/config.yaml
Expand Up @@ -5,9 +5,11 @@ default:
timezone: Europe/Stockholm
app_uuid: 1d2cc80e-62e3-4ab2-bd52-05194baa3f5d
charset: sv-se
locale:
all: sv_SE.UTF-8
textdomain: Milk
languages:
sv:
locale:
all: sv_SE.UTF-8
textdomain: Milk
cookie:
domain: .maklarpaket.se
session:
Expand Down

0 comments on commit e40ee68

Please sign in to comment.