Download the PHP package unclecheese/betterbuttons without Composer

On this page you can find all versions of the php package unclecheese/betterbuttons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package betterbuttons

Much of this module is getting merged into core

https://github.com/silverstripe/silverstripe-admin/issues/436

But I want to use it now!

If you're looking to use it in SS4 ahead of the merge, you can use this branch.

Build Status

Screenshot

Modifies the detail form of GridFields to use more user-friendly actions, including:

Create custom actions the detail view

Screenshot

Requirements

SilverStripe 4.0 or higher

Installation

Customising the button collections

Preferences for which buttons should appear where will vary from user to user. BetterButtons comes with a default set of button collections for the "create" and "edit" views in a GridField detail form, but these can be easily overridden in a config.yml file.

The default configuration:

Each button type is assigned a symbol in the YAML definition. It can be placed anywhere any number of times. Further, it can be placed in a named group, provided that group has been defined in the BetterButtonsGroups node. A button group is a single button with a label that exposes a series of options on click.

Because of the idiosyncracies of the Config layer merging arrays, the buttons must be defined as on or off (true or false). To remove a button from the default configuration, you must explicitly set it to false in your project configuration. Here is an example custom configuration.

When creating groups, be sure not to duplicate any buttons that are outside the group, as form fields with the same name cannot appear twice in a form.

Creating a custom action

In the example below, we'll create a custom action in the GridField detail form that updates a DataObject to be "approved" or "denied."

We can add the action in one of two places:

First, we'll overload the model's or method, depending on where we want the button to appear in the UI.

The object takes parameters for the method name ("deny" or "approve") to invoke on the model, as well as a label for the button.

Now let's add the methods to the DataObject.

Lastly, for security reasons, we need to whitelist these methods as callable by the GridField form. This works a lot like in controllers.

Now we have a new button in the UI!

Screenshot

Customising the user experience

Let's ensure that the form refreshes after clicking "approve" or "deny".

The redirect type can use the constants:

To refresh the form, or go back to list view, respectively.

Additionally, we can add a success message that will render on completion of the action by returning a message in our method.

Defining arbitrary links

Sometimes, you might not want to sent a request to the controller at all. For that, there's the much simpler class.

Screenshot

Creating nested forms

You may have an action that needs to prompt for user input, for example "Send this customer message" on an Order record. For complex actions like these, you can use BetterButtonNestedForm.

In this case, your action handler receives $data and $form, just like a controller would.

Disabling Better Buttons

Sometimes you might find it necessary to disable better buttons on certain classes. You can do this by changing the static better_buttons_enabled to be false via YML configuration.


All versions of betterbuttons with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ^4.0@dev
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package unclecheese/betterbuttons contains the following files

Loading the files please wait ....