Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robinn1/php-ui-kit

A toolkit for developing universal web interfaces with support for multiple CSS frameworks.
https://github.com/robinn1/php-ui-kit

bootstrap css fomantic-ui framework kit php php-ui-kit semantic-ui templating twig ui uikit

Last synced: about 8 hours ago
JSON representation

A toolkit for developing universal web interfaces with support for multiple CSS frameworks.

Awesome Lists containing this project

README

        

# PHP UI Kit

A toolkit for developing universal web interfaces with support for multiple CSS frameworks.

![Visitor Badge](https://visitor-badge.laobi.icu/badge?page_id=RobiNN1.PHP-UI-Kit)

[Documentation](https://uikit.kelcak.com/)

## Installation

```
composer require robinn/uikit
```

## Basic Usage

Simply print everything with echo.

```php
ob_start();

echo 'HTML code';
echo alert('Default');

echo layout(ob_get_clean(), [
'title' => 'Site title',
]);
```

It is also possible to call components in a template:

```php
$html = get_ui()
->addPath(__DIR__.'/templates') // Path to dir with custom templates
->render('page'); // page.twig in templates/ dir

echo layout($html, [
'title' => 'Site title',
]);
```

`page.twig`

```twig
HTML code
{{ alert('Default') }}
```

There are multiple syntaxes available. It's up to you which one you choose.

> Note: no need to use `layout()`, you can use own logic as well.

## Requirements

- PHP >= 8.2