Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f77fe9ee9 | ||
|
|
eaa314786c | ||
|
|
c9913b99a4 |
@@ -10,12 +10,12 @@ Stable version
|
|||||||
composer require rmphp/content
|
composer require rmphp/content
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
composer require rmphp/content:"^1.0"
|
composer require rmphp/content:"^1.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Dev version contains the latest changes
|
Dev version contains the latest changes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer require rmphp/content:"1.0.x-dev"
|
composer require rmphp/content:"1.x-dev"
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Rmphp\Content;
|
namespace Rmphp\Content;
|
||||||
|
|
||||||
|
use Rmphp\Foundation\Exceptions\AppError;
|
||||||
use Rmphp\Foundation\Exceptions\AppException;
|
use Rmphp\Foundation\Exceptions\AppException;
|
||||||
use Rmphp\Foundation\TemplateInterface;
|
use Rmphp\Foundation\TemplateInterface;
|
||||||
|
|
||||||
@@ -140,9 +141,10 @@ class Content implements TemplateInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws AppException
|
||||||
*/
|
*/
|
||||||
public function getResponse(): string {
|
public function getResponse(): string {
|
||||||
if (empty($this->template) || !file_exists($this->template)) return '';
|
if (empty($this->template) || !file_exists($this->template)) throw new AppError("Invalid template file");
|
||||||
ob_start(); include $this->template; $out = ob_get_contents(); ob_end_clean();
|
ob_start(); include $this->template; $out = ob_get_contents(); ob_end_clean();
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user