Repository navigation
Widget
Viames Marino edited this page Feb 22, 2026
·
1 revision
Pair\Html\Widget renders reusable PHP widget snippets from the application widget folder.
Default widget folder:
APPLICATION_PATH/widgets/
Each widget is a .php file (for example widgets/stats.php).
use Pair\Html\Widget;
$widget = new Widget('stats');
$html = $widget->render();Sets widget name (file without extension).
Loads APPLICATION_PATH/widgets/<name>.php and returns rendered HTML.
If file is missing, throws PairException with ErrorCodes::WIDGET_NOT_FOUND.
Returns list of available widget names by scanning widget folder.
$list = Widget::availableWidgets();- Widget rendering is output-buffer based (
ob_start+require). - Widget file has access to currently available PHP scope at render time.
See also: View, Application, Classes-folder.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4