new: [instance] scope added
parent
5b78e0d63a
commit
079bff26c3
|
@ -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'));
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$Parsedown = new Parsedown();
|
||||
echo $Parsedown->text($md);
|
Loading…
Reference in New Issue