Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated example to use Http/Request and Http/Response
- Loading branch information
Showing
3 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters