FEATURE: move default Handler::render() into parent class

This commit is contained in:
Michal Kváček
2016-09-23 23:57:23 +02:00
parent a9aaf797cd
commit 9d33ae6d49
7 changed files with 21 additions and 57 deletions
+14
View File
@@ -2,6 +2,7 @@
namespace App\Handlers;
use App\Handlers\Contracts\AppHandler;
use App\Http\Controllers\Controller;
use App\Models\Content;
/**
@@ -29,6 +30,19 @@ abstract class Handler extends BaseHandler implements AppHandler
return History::class;
}
/**
* Render given module into visitor area.
*
* @param Content $content DB model from table contents
* @param array $parameters parameters used for modifications/custom settings of given model
*
* @return mixed
*/
public function render(Content $content, $parameters)
{
return Controller::VisitorsView($content->template, ['page' => $content, 'extra' => $parameters]);
}
public static function getExtendedFormSections()
{
return [