FEATURE: add command for displaying info about currently set template

This commit is contained in:
Michal Kváček
2017-02-23 18:23:59 +01:00
parent 26854b7207
commit 93fc9316a4
3 changed files with 45 additions and 2 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Console\Commands;
use App\CMS\Helpers\CurrentTemplate;
use Illuminate\Console\Command;
class TemplateInfo extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'template:info';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Show details about currently set template';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$template = CurrentTemplate::get();
if (is_null($template)) {
$this->error('No template set.');
return;
}
$this->line($template->name);
$this->line($template->handler);
}
}