Download the PHP package rafaelwendel/ci4alerts without Composer

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

CI4Alerts

CI4Alerts is a helper library for the CodeIgniter 4 framework designed to simplify the creation, management, and display of message alerts (such as success, error, and warning messages) using the most popular CSS frameworks: Bulma, Bootstrap, Materialize, and Tailwind CSS.


Installation

The package can be easily installed via Composer. Run the following command in your terminal at the root of your CodeIgniter 4 project:


Configuration

Setup Command (Spark)

After installing the library, you should publish the package's default configuration template file to your application's Config directory (app/Config). To do this, run the Spark command below in your terminal:

This command will copy the configuration template file to app/Config/Alerts.php.


Configuration Options

When you open app/Config/Alerts.php, you will find the following configuration options:

Adding Custom Configurations

If you do not want to use any of the built-in libraries, you can easily define your own custom configurations by adding new keys to the $config array. To use a custom configuration, simply set the $active property to your custom key:

You can then load your custom theme automatically:

Or load it explicitly by passing its key as an argument:


Usage Examples

1. Obtaining the Service Instance

The recommended way to instantiate the library is using CodeIgniter 4's service() helper:


2. Setting Alert Messages (Controller)

You can store alert messages in session flashdata to display them after a redirect (e.g., after saving a form):


3. Displaying Alert Messages (Views)

Automatic Session (Flashdata) Display

To display the alert set in the controller, simply call the display() method in your view:

Direct Display (Without Session / Static Rendering)

If you prefer to render a message directly in the view, pass the parameters to the display() method:

Shortcut Helper Methods

You can also use type-specific shortcut methods directly in the view:


All versions of ci4alerts 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/ci4alerts contains the following files

Loading the files please wait ...