I am new to webdevelopment,we are developing a quiz game using PHP and MYSQL.I would like to know what would be the best library for PHP for UI development. The library which could handle the compatablity issues across the browsers and provide rich UI.
Thanks in advance.
PHP has nothing to do with client-side UI thus there are no PHP libraries for this task. This is typically handled using JavaScript or CSS frameworks
The same quest has prompted me to start this project: Agile UI - a PHP UI Component Library.
My goal is to let developers focus on the business tasks and use standard UI implementation for a web/responsive application. This won't solve 100% of use-cases, but it is a quick-and-effective solution. (For more complex scenarios, I recommend using ReactJS with RestAPI).
Agile UI is a relatively new project but it is maturing very quickly and you are welcome to try it out. There are no heavy dependencies and code is designed to work out-of-the-box.
composer require atk4/ui
Add this code to a file:
include 'vendor/autoload.php';
$app = new \atk4\ui\App('My App'); $app->initLayout(new \atk4\ui\Layout\Admin());
$db = \atk4\data\Persistence::connect($DSN);
class User extends \atk4\data\Model { public $table = 'user'; function init() { parent::init();
$this->addField('name');
$this->addField('email', ['required'=>true]);
$this->addField('password', ['type'=>'password']);
}
}
$app->layout->add(new \atk4\ui\CRUD()) ->setModel(new User($db));
The result should look like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With