-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
Muhammet Şafak edited this page Jun 10, 2026
·
1 revision
| Requirement | Version |
|---|---|
| PHP | 8.1 or later |
ext-json |
bundled with PHP |
initphp/parameterbag |
^2.0 |
initphp/validation |
^2.0 |
The two InitPHP dependencies are installed automatically by Composer.
composer require initphp/inputThen make sure the Composer autoloader is loaded once in your application's entry point:
require_once __DIR__ . '/vendor/autoload.php';<?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use InitPHP\Input\Inputs;
$input = new Inputs(get: ['ping' => 'pong']);
echo $input->get('ping'); // pongIf that prints pong, you are ready to go.
use InitPHP\Input\Inputs; // the instance API
use InitPHP\Input\Facade\Inputs as Input; // the static facade-
Inputs— create it yourself (new Inputs()), optionally with explicit data. Best for dependency injection and tests. -
Facade\Inputs— a static proxy that lazily builds oneInputsfrom the superglobals. Best for quick reads in application code.
Both expose exactly the same methods. See The Facade for the difference and when to use which.
initphp/input · MIT License · part of the InitPHP family
Source · Issues · Discussions · Packagist · Contributing · Security Policy
Getting Started
Usage
Reference
Other