Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dartmoon-io/prestashop-tabmanager
https://github.com/dartmoon-io/prestashop-tabmanager
prestashop prestashop-library
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dartmoon-io/prestashop-tabmanager
- Owner: dartmoon-io
- License: mit
- Created: 2021-03-10T21:34:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-21T13:54:03.000Z (over 1 year ago)
- Last Synced: 2024-04-26T07:22:22.289Z (8 months ago)
- Topics: prestashop, prestashop-library
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prestashop TabManager
A simple package that allows you to add your controllers to the PrestaShop Backoffice menu. Simply define an array with all the menu items and let the package install them.## Installation
1. Install the package
```bash
composer require dartmoon/prestashop-tabmanager
```2. Define an array called `menu_tabs` inside the main class of your module
```php
//...
protected $menu_tabs = [
//
];
//...
```4. Fix `install` and `unistall` method of your module
```php
//...
public function install()
{
if (
parent::install()
&& TabManager::install($this->menu_tabs, $this)
// && $this->registerHook(...)
) {
//...return true;
}return false;
}public function uninstall()
{
//...
TabManager::uninstallForModule($this);
return parent::uninstall();
}
//...
```## Usage
Simply add all the menu items to the `menu_tabs` array.
```php
protected $menu_tabs = [
[// This is a parent tab
'name' => 'Parent tab',
'class_name' => 'UNIQUE_TAB_NAME',
'route_name' => '',
'parent_class_name' => '',
'icon' => 'settings',
'visible' => true,
],
[ // This a child of the previus tab
'name' => 'Child tab',
'class_name' => 'MySuperClass', // Remember that the controller class name is MySuperClassController, but we need to add it without the suffix "Controller"
'route_name' => '',
'parent_class_name' => 'UNIQUE_TAB_NAME',
'icon' => '',
'visible' => true,
],
];
```## License
This project is licensed under the MIT License - see the LICENSE.md file for details