Skip to content

Instantly share code, notes, and snippets.

@tabuna
Created October 31, 2017 21:19
Show Gist options
  • Save tabuna/88f9f8a5880b793f5afef9a1a4c63c09 to your computer and use it in GitHub Desktop.
Save tabuna/88f9f8a5880b793f5afef9a1a4c63c09 to your computer and use it in GitHub Desktop.
Screen Draft
<?php
namespace App\Core\Screens;
use App\Core\Layout\TestColums;
use Illuminate\Http\Request;
use Orchid\Platform\Screen\Screen;
class Demo extends Screen
{
/**
* Display header name
*
* @var string
*/
public $name = 'Demo Screen';
/**
* Display header description
*
* @var string
*/
public $description = 'Testing Screen Capabilities';
/**
* Query data
*
* @return array
*/
public function query(): array
{
return [
'content' => [
'en' => [
'name' => 'Test',
],
]
];
}
/**
* Button commands
*
* @return array
*/
public function commandBar() : array
{
return [
'create' => [
'displayName' => 'Новая запись',
'description' => 'Создать новую запись',
'method' => 'create',
],
'create2' => [
'displayName' => 'Вывести на печать',
'description' => 'Создать новую запись',
'method' => 'create',
],
'create3' => [
'displayName' => 'Новая функция 1',
'description' => 'Создать новую запись',
'method' => 'create',
],
'create4' => [
'displayName' => 'Новая функция 2',
'description' => 'Создать новую запись',
'method' => 'create',
],
'create5' => [
'displayName' => 'Новая функция 3',
'description' => 'Создать новую запись',
'method' => 'create',
],
];
}
/**
* Views
*
* @return array
*/
public function layout() : array
{
return [
TestColums::class,
];
}
/**
* @param Request $request
*
* @return null
*/
public function create(Request $request)
{
return response(200);
}
}
<?php
namespace App\Core\Layout;
use Orchid\Platform\Layouts\Colums;
class TestColums extends Colums
{
/**
* Views
*
* @return array
*/
public function layout(): array
{
return [
'Колонка 1' => [
TestRows::class,
],
'Колонка 2' => [
TestRows2::class,
TestTable::class,
],
'Колонка 3' => [
TestTabs::class,
],
];
}
}
<?php
namespace App\Core\Layout;
use Orchid\Platform\Layouts\Rows;
class TestRows extends Rows
{
/**
* @return array
*/
public function fields() : array
{
return [
'name' => 'tag:input|type:text|name:name|max:255|required|title:Name Articles|help:Article title',
'free' => 'tag:checkbox|name:robot|max:255|required|title:Free|help:Event for free|placeholder:Event for free|default:1',
'block' => 'tag:code|name:block|title:Code Block|help:Simple web editor',
'title' => 'tag:input|type:text|name:title|max:255|required|title:Article Title|help:SEO title',
'description' => 'tag:textarea|name:description|max:255|required|rows:5|title:Short description',
'keywords' => 'tag:tags|name:keywords|max:255|required|title:Keywords|help:SEO keywords',
'robot' => 'tag:robot|name:robot|max:255|required|title:Indexing|help:Allow search bots to index page',
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment