Homepage
Main navigation
Main content
Additional information
October Tricks
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
October CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
Plugin's settings registration: ```php public function registerSettings() { return [ 'settings' => [ 'label' => 'Test Settings', 'description' => 'Test settings descr', 'class' => 'AuthorName\PluginName\Models\Settings', ], ]; } ``` Plugin's navigation registration: ```php public function registerNavigation() { return [ 'main-menu' => [ 'label' => 'Test Menu', 'url' => Backend::url('AuthorName/PluginName/test'), 'sideMenu' => [ 'side-menu-item' => [ 'label' => 'Settings', 'url' => Backend::url('AuthorName/PluginName/settings'), ], ], ], ]; } ``` Controller definition: ```php <?php namespace AuthorName\PluginName\Controllers; use BackendMenu; use Redirect; use Request; class Settings extends \System\Controllers\Settings { protected $author; protected $plugin; protected $code = 'settings'; // see registerSettings() protected $mainMenuId = 'main-menu'; // see registerNavigation() protected $sideMenuId = 'side-menu-item'; // see registerNavigation() public function __construct() { parent::__construct(); $this->viewPath = base_path().'/modules/system/controllers/settings'; // Extract Author and Plugin name from current class path list($this->author, $this->plugin) = explode('\\', get_class()); BackendMenu::setContext(sprintf('%s.%s', $this->author, $this->plugin), $this->mainMenuId, $this->sideMenuId); } public function index() { $url = sprintf('%s/update/%s/%s/%s', Request::url(), $this->author, $this->plugin, $this->code); return Redirect::to($url); } } ```
References
Add additional online resources to your trick
×
Name
URL
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline