Download the PHP package mspirkov/yii2-web without Composer

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

Yii2 Web Extension

A package of helper classes for working with web components in Yii2.

PHP Yii 2.0.x Tests PHPStan Coverage PHPStan Level Max

Installation

Run

or add

to the require section of your composer.json file.

Components

CookieManager

A utility class for managing cookies.

This class encapsulates the logic for adding, removing, checking existence, and retrieving cookies, using the \yii\web\Request and \yii\web\Response objects. It simplifies working with cookies by abstracting implementation details and providing more convenient methods.

It contains the following methods:

Usage example

Initialization

Add the definition to the container configuration in the definitions section:

Usage

Html

This package contains 4 helpers:

  1. MSpirkov\Yii2\Web\Html - a helper that extends yii\web\Html
  2. MSpirkov\Yii2\Web\Bootstrap3\Html - a helper that extends yii\bootstrap\Html
  3. MSpirkov\Yii2\Web\Bootstrap4\Html - a helper that extends yii\bootstrap4\Html
  4. MSpirkov\Yii2\Web\Bootstrap5\Html - a helper that extends yii\bootstrap5\Html

[!IMPORTANT]

To use Bootstrap helpers, you need to install the corresponding packages (yii2-bootstrap, yii2-bootstrap4, or yii2-bootstrap5)

All of them contain methods from the HtmlTrait and allow you to use its features without having to create your own basic helper.

HtmlTrait

A trait that extends the basic functionality of the \yii\helpers\Html helper.

Usage example

You can also use this trait with other helpers that extends \yii\helpers\Html. For example:

Method singleButtonForm

Сreates a form as a single button with hidden inputs. This can be useful when you need to perform an action when you click a button, such as deleting an item. This allows you to easily perform a request without manually creating a form, hidden inputs, etc.

Usage example:

Request

A wrapper for \yii\web\Request that uses the capabilities of RequestTrait and allows you to use them without having to create your own basic Request.

Configuration

First, you need to replace the request component in the configuration:

IDE Autocomplete (Optional)

You also need to specify this class in __autocomplete.php so that the IDE knows which class to use:

Basic Controller (Optional)

I also recommend that you create your own basic controller and specify Request there:

Usage example

RequestTrait

A trait for easier handling of GET and POST parameters.

[!IMPORTANT]

All parameter retrieval methods also allow you to mark parameters as required using the $required parameter.

It contains the following methods:

Usage example


All versions of yii2-web with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
yiisoft/yii2 Version ^2.0.53
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 mspirkov/yii2-web contains the following files

Loading the files please wait ...