[4.0][RFC][WIP] New Toolbar Interface (for PHP)#19670
[4.0][RFC][WIP] New Toolbar Interface (for PHP)#19670wilsonge merged 37 commits intojoomla:4.0-devfrom
Conversation
# Conflicts: # libraries/vendor/composer/autoload_classmap.php # libraries/vendor/composer/autoload_files.php # libraries/vendor/composer/autoload_static.php
|
@asika32764 @Fedik can you please coordinate this task? |
|
@asika32764 Please take the time to correct the Codestyle items here. It will help with the overall consideration of your proposal. You can use the PHPCS codestyle autofixers to automatically fix a number of the items in your PR. Just remember to keep it to the files related to your PR. |
|
Still Work in process, will fix all CS and docblock later. |
| button:first-of-type { | ||
| margin: 0; | ||
| > *:first-child { | ||
| margin: 0; |
There was a problem hiding this comment.
Line should be indented 4 spaces, but was indented 6 spaces
|
did you use patchtester to test it? Maybe is the same reason of #19670 (comment) |
|
@asika32764 , yes. I used patch tester to test it |
|
@asika32764 can we get this upto date with 4.0 please. I really like this concept and would like to get it in :) |
|
OK. A little busy that I stop developing this PR. Well continue finish this maybe this weekend. |
|
OK I've fixed the conflicts myself and made the decision to merge this for now so we can all work on it in the main repo :) |
|
Thanks for the hard work that went into this!! |
|
Thank you, sorry for the delayed since there are some serious projects I must to complete in this month. |
|
I still must write some documentation. If you need the doc, please tag me. |
|
Don't worry :) Thankyou so much for doing what you could! |
|
were docs ever created for this? |
|
No. See #19670 (comment) |

This is a new toolbar interface design on PHP part. Related to #18392 and #19635
Introduction
Currently we use
JToolbarHelperto add buttons to component view. But there are some problems of this interface.First, too many arguemnts on some methods, for instance:
Second, hard to add a custom button, the
Toolbar::appendButton()has no type hint, we must look every Button classes to learn how to use them.Then, it is impossible to customize some standard buttons or add dropdown. All standard buttons are hard coded.
The Changes
I try to create a fluent interface that provides a flexible Toolbar button definition process:
All arguments are options.
And IDE friendily
Layout
Buttons can override layout and HTML classes:
Button Group
Use callback to easily customize your dropdown buttons.
Confirm Button
Pre-Defined Buttons
No B/C break
If a component was using
ToolbarHelperor$bar->appendButton(), it should fully B/C.This PR is WIP, I changed com_content component to use new Toolbar syntax, it works very well: