Download the PHP package bugo/smf-bricks without Composer

On this page you can find all versions of the php package bugo/smf-bricks. 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 smf-bricks

SMF Bricks

SMF 2.1 PHP Coverage

По-русски

These helpers will be useful for simplifying the code of tables and forms when creating modifications to Simple Machines Forum.

Installing

In the root directory of your modification, run the command:

Then, include autoload.php in your code:

Tables

The simple table builder TableBuilder::make() — you just need to provide the data, and you'll get a table styled like on the forum:

preview

Anyone who has ever set up a table structure in SMF 2.1 knows that you first create an array called $listOptions with the key settings. This array looks bigger the more columns you need to include in it:

So how can you create such a structure using TableBuilder? Thanks to the fluent interface, it's very elegant and simple:

We build with the builder, and with the presenter, we display what we've built:

Instead of the universal method withParams, there are also more specific ones: paginate, setNoItemsLabel, setFormAction, and setDefaultSortColumn.

Columns are created using Column::make():

There are also several child methods that inherit from Column: IdColumn, CheckboxColumn. You can easily create similar ones for your projects. For example, IdColumn is just a wrapper for a structure like:

When adding multiple columns, you can use the method addColumns([Column::make(), Column::make(), ...]), which accepts an array of Column instances.

You can also add buttons ABOVE or BELOW the table using the methods addRows([Row::make($button1), Row::make($button2)]) or addRow(Row::make($button)), where Row::make accepts text or HTML. The position of the buttons can be changed using the setPosition method, which takes one of the values from the RowPosition enumeration. By default, the buttons are displayed below the table.

Forms

What could be more interesting than building all sorts of forms, especially in SMF? Of course, creating and using a FormBuilder for such forms:

You can add form fields in a container (by specifying the block class as the second parameter):

Or without it:

You can add your own buttons at the bottom of the form, specifying a class for the container as well as a class for all buttons inside the container:

You can also add hidden fields:

Of course, there is a dedicated presenter for FormBuilderFormPresenter, designed to display the built forms in the browser:

preview

Settings

We’re excited to share some good news for those who find working with arrays while creating settings a bit tedious. For instance, the Light Portal settings block on the "Miscellaneous" tab was previously built like this:

Now, thanks to ConfigBuilder and a set of child classes from AbstractConfig, everything looks much more interesting:

More usage examples can be found in the tests, as well as in the Light Portal project.


All versions of smf-bricks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
nette/utils Version ^4.0
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 bugo/smf-bricks contains the following files

Loading the files please wait ....