Skip to content

Commit

Permalink
Minor code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
AliasIO committed Jun 19, 2013
1 parent e80e857 commit d4bb11b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ class Foo extends \Swiftlet\Controller
// Get an instance of the Example class (Swiftlet/Models/Example.php)
$exampleModel = $this->app->getModel('example');

$helloWorld = $exampleModel->getHelloWorld();

$this->view->helloWorld = $helloWorld;
$this->view->helloWorld = $exampleModel->getHelloWorld();
}
}
```
Expand Down
5 changes: 4 additions & 1 deletion Swiftlet/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public function run()
public function serve()
{
ob_start();

$this->view->render();

ob_end_flush();
}

Expand All @@ -129,7 +131,8 @@ public function getConfig($variable)
if ( isset($this->config[$variable]) ) {
return $this->config[$variable];
}
return null;

return null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Swiftlet/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ abstract class Model implements Interfaces\Model

/**
* Constructor
* @param object $app
* @param Interfaces\App $app
*/
public function __construct(Interfaces\App $app)
{
Expand Down
2 changes: 1 addition & 1 deletion Swiftlet/Plugins/Example.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Example extends \Swiftlet\Plugin
*/
public function actionAfter()
{
if ( get_class($this->controller) === 'Swiftlet\Controllers\Index' ) {
if ( $this->app->getControllerName() === 'Index' ) {
$this->view->helloWorld .= ' This string was altered by ' . __CLASS__ . '.';
}
}
Expand Down
2 changes: 1 addition & 1 deletion Swiftlet/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(Interfaces\App $app, $name)
* @param bool $htmlEncode
* @return mixed|null
*/
public function get($variable, $htmlEncode = true)
public function get($variable, $htmlEncode = true)
{
if ( isset($this->variables[$variable]) ) {
if ( $htmlEncode ) {
Expand Down

0 comments on commit d4bb11b

Please sign in to comment.