Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
Changed namespace again
Removed unnecessary info from .gitignore
  • Loading branch information
silentworks committed Sep 29, 2015
1 parent 5003871 commit c17016c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
.DS_Store
composer.lock
phpunit.xml
vendor
.idea
clover.xml
cache/
composer.phar
composer.lock
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
## Usage

```
```php
$app = new Slim\App();
$container = $app->getContainer();
$container['renderer'] = new SlimRenderer("./templates");
$container['renderer'] = function () {
return new Geggleto\Renderer\SlimRenderer("./templates");
};

$app->get('/hello/{name}', function ($request, $response, $args) {
//You will now have $name available in your template
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
}
],
"require": {
"slim/slim": "3.0.0-RC1"
"slim/slim": "^3.0.0-RC1"
},
"autoload" :{
"psr-4" : { "Renderer\\" : "src" }
"psr-4" : { "Geggleto\\Renderer\\" : "src" }
}
}
11 changes: 5 additions & 6 deletions src/SlimRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
* Time: 1:14 PM
*/

namespace Geggleto;
namespace Geggleto\Renderer;

use Slim\Http\Response;

/**
* Class SlimRenderer
*
* @package Renderer
* @package Geggleto\Renderer
*/
class SlimRenderer
{
/**
* @var string
*/
protected $templatePath = "";
protected $templatePath;

/**
* SlimRenderer constructor.
Expand All @@ -38,8 +37,8 @@ public function __construct($templatePath = "")
* Inserts template into Response object
*
* @param \Slim\Http\Response $response
* @param $template
* @param array $data
* @param string $template
* @param array $data
* @return \Slim\Http\Response
*/
public function render(Response $response, $template, array $data = [])
Expand Down

0 comments on commit c17016c

Please sign in to comment.