Download the PHP package rafaelwendel/ci4tablemaker without Composer

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

CI4TableMaker

CI4TableMaker is a helper library for the CodeIgniter 4 framework designed to extend the capabilities of the native CodeIgniter\View\Table class.

It simplifies the task of dynamically injecting action columns (such as "Edit", "Delete", or custom buttons) into HTML tables. It features support for conditional action links per row (e.g., showing a button only if the user is an Admin) and dynamic placeholder substitution for database columns in URLs.


🚀 Installation

Add the package to your CodeIgniter 4 project using Composer:

[!NOTE] If you are using the class directly in your project's app/Libraries/ folder without Composer, you can import it using the local namespace use App\Libraries\TableMaker;. If you installed the package via Composer, import it using the package namespace: use CI4TableMaker\TableMaker;.


🛠️ How to Use

1. Basic Usage

In your Controller, fetch your users' dataset (with columns id, name, and profile), define the action links, and send the helper instance to your View.

In your View (app/Views/users/index.php), simply print the object:

The code produces the following result: ID Name Profile Actions
1 Roger Federer Admin Delete
2 Rafael Nadal Author Delete
3 Novak Djokovic Editor Delete
4 Andy Murray Admin Delete

2. Conditional Action Links

You can set conditions so an action link is only displayed if specific criteria are met. The library supports the following operators: ==, ===, !=, >, <, >=, <=.

For example, to display an "Advanced Settings" link only for users whose profile is 'Admin':

Result: ID Name Profile Actions
1 Roger Federer Admin Advanced Settings
2 Rafael Nadal Author Delete
3 Novak Djokovic Editor Delete
4 Andy Murray Admin Advanced Settings

3. Dynamic URL Placeholders

The library replaces wildcards inside your URL paths using any column key available in your dataset.


4. Selecting and Ordering Columns

Using the setColumns() method, you can specify exactly which columns of your dataset should be displayed in the final HTML table and define their exact order.


📖 Methods Reference

setHeading(...$heading): void

Sets the table headers. Accepts an array or discrete arguments.

setFooting(...$footing): void

Sets the table footer. Accepts an array or discrete arguments.

setTemplate(array $template): void

Sets the HTML table template using CodeIgniter 4's Table library array layout.

setData(iterable $data): void

Injects the dataset (array of arrays, array of objects, or database query results) that will populate the table.

setUrlBase(string $urlBase): void

Sets the prefix URL base for all action link paths.

setColumns(array $columns): void

Specifies which columns should be displayed in the HTML table and sets their render order.

setSeparator(string $separator): void

Defines the separator string inserted between action links. Default: &nbsp;.

addLink(string $path, ?string $param, string $title, array|string $attr = '', ?array $condition = null): void

Adds an action link.

display(bool $returnData = false, string $indexTitle = 'actions'): array|string

Generates and returns the table as an HTML string by default, or returns the processed dataset as an array if $returnData is true.


📄 License

This project is licensed under the MIT License.


All versions of ci4tablemaker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 rafaelwendel/ci4tablemaker contains the following files

Loading the files please wait ...