new: [instance] scope added

remotes/origin/main
iglocska 2020-06-21 21:29:25 +02:00
parent 5b78e0d63a
commit 079bff26c3
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
5 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
use Cake\Utility\Hash;
use Cake\Utility\Text;
use \Cake\Database\Expression\QueryExpression;
class InstanceController extends AppController
{
public function home()
{
$this->set('metaGroup', $this->isAdmin ? 'Administration' : 'Cerebrate');
$this->set('md', file_get_contents(ROOT . '/../README.md'));
}
}

View File

View File

@ -0,0 +1,20 @@
<?php
namespace App\Model\Table;
use App\Model\Table\AppTable;
use Cake\ORM\Table;
use Cake\Validation\Validator;
class InstanceTable extends AppTable
{
public function initialize(array $config): void
{
parent::initialize($config);
}
public function validationDefault(Validator $validator): Validator
{
return $validator;
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\View\Helper;
use Cake\View\Helper;
use Cake\Utility\Hash;
class MarkdownHelper extends Helper
{
private $Parsedown = null;
public function text($input)
{
return $this->Parsedown->text($input);
}
public function line($input)
{
return $this->Parsedown->line($input);
}
}

View File

@ -0,0 +1,3 @@
<?php
$Parsedown = new Parsedown();
echo $Parsedown->text($md);