Docs / Reference
Core
Creating a Flick instance, and the properties available on it.
Static Methods
Flick::make
Creates a new Flick form instance. A fluent alternative to new Flick().
use Flick\Flick; // Basic usage $form = Flick::make(); // With configuration array $form = Flick::make([ 'id' => 'contactForm', 'views' => 'bootstrap', 'csrf' => true ]); // Shorthand: pass view name directly $form = Flick::make('tailwind');
Parameters:
$config-array|string(optional) - Configuration array or view name string
Returns: Flick - A new Flick instance
Properties
handlers
- Type:
ResponseHandlers - The response handlers instance for customizing how Flick responds to events.
Access this property to customize response behavior after instantiation:
$form = Flick::make('bootstrap'); // Customize handlers after creation $form->handlers->onRedirect(fn($r) => redirect($r->getUrl())); $form->handlers->onHoneypot(fn() => abort(403));
Or configure handlers at instantiation time via the config array:
$form = Flick::make([ 'onRedirect' => fn($r) => redirect($r->getUrl()), 'onHoneypot' => fn() => abort(403), ]);
See Framework Integration for detailed usage.
session
- Type:
SessionInterface - The session adapter instance used by Flick.
Access this property to interact with the session directly:
$form = Flick::make('bootstrap'); // Store and retrieve values $form->session->setValue('step', 1); $currentStep = $form->session->getValue('step'); // Regenerate session ID (security - call after login) $form->session->regenerateId(true); // Check session state if ($form->session->isActive()) { // Session is ready }
See Session Adapters for custom adapters and framework integration.