Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n2ref/coreui-panel-php
CoreUI Panel php
https://github.com/n2ref/coreui-panel-php
Last synced: 20 days ago
JSON representation
CoreUI Panel php
- Host: GitHub
- URL: https://github.com/n2ref/coreui-panel-php
- Owner: n2ref
- Created: 2023-04-08T14:48:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T18:44:54.000Z (5 months ago)
- Last Synced: 2024-12-19T13:31:37.464Z (27 days ago)
- Language: PHP
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CoreUI Panel
### Composer install
`composer install n2ref/coreui-panel`
### Example usage
```php
$panel = new \CoreUI\Panel('panel-id');
$panel->setTitle('Component Panel', 'CoreUI Framework');
$panel->addControlButton('Help');
$panel->setTabsType($panel::TABS_TYPE_TABS);
$panel->setTabsPosition($panel::TABS_POS_TOP_LEFT);
$panel->setTabsFill($panel::TABS_FILL_JUSTIFY);
$panel->setTabsWidth(200);
$panel->addTab('Home', 'tab1', 'data/tab1.json')->setActive(true);
$panel->addTab('Profile', 'tab2', 'data/tab2.json');
$panel->addTab('Disabled')->setDisabled(true);
$tab_dropdown = $panel->addDropdown('Dropdown');
$tab_dropdown->addItem('Tab title 3')->setDisabled(true);
$tab_dropdown->addItem('Tab title 4', 'tab4', 'data/tab3.json');
$tab_dropdown->addDivider();
$tab_dropdown->addItem('Tab title 5', 'tab5', 'data/tab4.json');// Переопределение активного таба
$panel->setActiveTab('tab2');
$panel->setContent('Your content 1');echo json_encode($panel->toArray());
```Output
```json
{
"component": "coreui.panel",
"id": "panel-id",
"title": "Component Panel",
"subtitle": "CoreUI Framework",
"controls": [
{ "type": "button", "attr": { "class": "btn btn-secondary" }, "content": "Help" }
],
"tabs": {
"type": "tabs",
"position": "top-left",
"fill": "justify",
"width": 200,
"items": [
{"id": "tab1", "title": "Home", "url": "data/tab1.json"},
{"id": "tab2", "title": "Profile", "active": true, "url": "data/tab2.json"},
{"id": "tab3", "title": "Disabled", "disabled": true},
{
"title": "Dropdown",
"type": "dropdown",
"items": [
{"id": "tab4", "title": "Tab title 3", "disabled": true},
{"id": "tab5", "title": "Tab title 4", "url": "data/tab3.json"},
{"type": "divider"},
{"id": "tab6","title": "Tab title 5", "url": "data/tab4.json"}
]
}
]
},
"content": "Your content 1"
}
```