PHPackages                             phpmv/php-mv-ui - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. phpmv/php-mv-ui

ActiveLibrary[Framework](/categories/framework)

phpmv/php-mv-ui
===============

A JQuery and UI library for php and php MVC frameworks

2.4.17(3mo ago)3319.7k↑94.8%4Apache-2.0PHPPHP &gt;=8.1

Since Jun 20Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/phpMv/phpMv-UI)[ Packagist](https://packagist.org/packages/phpmv/php-mv-ui)[ RSS](/packages/phpmv-php-mv-ui/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (1)Versions (75)Used By (0)

[![php-mv-UI](https://camo.githubusercontent.com/6543084574896841584fa317c25893a0f328e0774b2fdbe9ba2e2d43a035e263/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f7068616c636f6e6973742f7068702d6d762d75692d2e706e67 "phpMv-UI")](https://camo.githubusercontent.com/6543084574896841584fa317c25893a0f328e0774b2fdbe9ba2e2d43a035e263/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f7068616c636f6e6973742f7068702d6d762d75692d2e706e67)

**Visual components library** (JQuery UI, Twitter Bootstrap, Semantic-UI) for php and php MVC frameworks

[phpMv-UI website](https://phpmv-ui.kobject.net/)

[![Build Status](https://camo.githubusercontent.com/62e118eeaff13b64d2ae2b15d2779d41f13a083cf54049f072ba726ac7f34bd7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068704d762f7068704d762d55492f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpMv/phpMv-UI/build-status/master) [![Latest Stable Version](https://camo.githubusercontent.com/4dfaddd119fbce883cb6cf0da7581a7f369270c9d2ef1a9ee19098dcfef8dedc/68747470733a2f2f706f7365722e707567782e6f72672f7068706d762f7068702d6d762d75692f762f737461626c65)](https://packagist.org/packages/phpmv/php-mv-ui) [![Total Downloads](https://camo.githubusercontent.com/ff27fb21fba607cd9c70fd1f66fa134657b6618d6cfc708ba5c66c4d75db912a/68747470733a2f2f706f7365722e707567782e6f72672f7068706d762f7068702d6d762d75692f646f776e6c6f616473)](https://packagist.org/packages/phpmv/php-mv-ui) [![License](https://camo.githubusercontent.com/dcfbb0b4926a617903c5afd24c10becfbdde3df15e0ae6168275ee811eec7014/68747470733a2f2f706f7365722e707567782e6f72672f7068706d762f7068702d6d762d75692f6c6963656e7365)](https://packagist.org/packages/phpmv/php-mv-ui)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fe7ae2981aa7ba70819334252066b6e2ab221904618f9e82689f5e1a85a4c8c6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068704d762f7068704d762d55492f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpMv/phpMv-UI/?branch=master)[![Documentation](https://camo.githubusercontent.com/d220576e66b59688ab47ac35471cd6eaa6c48a514faa2986ae91da1e188a7b83/68747470733a2f2f636f6465646f63732e78797a2f7068704d762f7068704d762d55492e737667)](http://api.kobject.net/phpMv-UI/)

What's phpMv-UI ?
-----------------

[](#whats-phpmv-ui-)

phpMv-UI is a visual components library for php : a php wrapper for jQuery and UI components (jQuery, Twitter Bootstrap, Semantic-UI).

Using the dependency injection, the jQuery object can be injected into **php framework container**, allowing for the generation of jQuery scripts in controllers, respecting the MVC design pattern.

Requirements/Dependencies
-------------------------

[](#requirementsdependencies)

- PHP &gt;= 7.0
- JQuery &gt;= 2.0.3
- JQuery UI &gt;= 1.10 \[optional\]
- Twitter Bootstrap &gt;= 3.3.2 \[optional\]
- Semantic-UI &gt;= 2.2 or Fomantic-UI &gt;= 2.7 \[optional\]

Resources
---------

[](#resources)

- [API](https://api.kobject.net/phpMv-UI/)
- [Documentation/demo](https://phpmv-ui.kobject.net/)
- [Semantic-ui](https://semantic-ui.com) [Fomantic-ui](https://fomantic-ui.com)

I - Installation
----------------

[](#i---installation)

### Installing via Composer

[](#installing-via-composer)

Install Composer in a common location or in your project:

```
curl -s http://getcomposer.org/installer | php
```

Create the composer.json file in the app directory as follows:

```
{
    "require": {
        "phpmv/php-mv-ui": "^2.3"
    }
}
```

In the app directory, run the composer installer :

```
php composer.phar install
```

### Installing via Github

[](#installing-via-github)

Just clone the repository in a common location or inside your project:

```
git clone https://github.com/phpMv/phpMv-UI.git

```

II PHP frameworks configuration
-------------------------------

[](#ii-php-frameworks-configuration)

### Library loading

[](#library-loading)

phpMv-UI complies with [PSR-4 recommendations](http://www.php-fig.org/psr/psr-4/) for auto-loading classes. Whatever the php framework used, with "composer", it is enough to integrate the Composer autoload file.

```
require_once("vendor/autoload.php");
```

### [![](https://camo.githubusercontent.com/c56850910dff6b0aefda8fc246fd407f4fbd8b63a6c03cf0ed9315c27edefef5/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f75626971756974792e706e67)](https://camo.githubusercontent.com/c56850910dff6b0aefda8fc246fd407f4fbd8b63a6c03cf0ed9315c27edefef5/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f75626971756974792e706e67) Ubiquity configuration

[](#-ubiquity-configuration)

#### Library loading

[](#library-loading-1)

The library is already loaded by default in the config file **app/config/config.php** :

```
	"di"=>array(
			"@exec"=>array("jquery"=>function ($controller){
						return \Ajax\php\ubiquity\JsUtils::diSemantic($controller);
					})
			),
```

#### Use in controllers

[](#use-in-controllers)

Example of creating a Semantic-UI button

```
/**
 * @property \Ajax\php\ubiquity\JsUtils $jquery
 */
class ExempleController extends Controller{
	public function index(){
		$semantic=$this->jquery->semantic();
		$button=$semantic->htmlButton("btTest","Test Button");
		echo $button;
	}
}
```

### [![](https://camo.githubusercontent.com/b5bc0cbc01a4ae5d45a670afda555ee9802f3b82d26bee978346ee7305010a4f/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f7068616c636f6e2e706e67)](https://camo.githubusercontent.com/b5bc0cbc01a4ae5d45a670afda555ee9802f3b82d26bee978346ee7305010a4f/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f7068616c636f6e2e706e67) Phalcon configuration

[](#-phalcon-configuration)

#### Library loading

[](#library-loading-2)

Without Composer, It is possible to load the library with the **app/config/loader.php** file :

```
$loader = new \Phalcon\Loader();
$loader->registerNamespaces(array(
		'Ajax' => __DIR__ . '/../vendor/phpmv/php-mv-ui/Ajax/'
))->register();
```

#### Injection of the service

[](#injection-of-the-service)

It is necessary to inject the JQuery service at application startup, in the service file **app/config/services.php**, and if necessary instantiate Semantic, Bootstrap or Jquery-ui :

```
$di->set("jquery",function(){
    $jquery= new Ajax\php\phalcon\JsUtils();
    $jquery->semantic(new Ajax\Semantic());//for Semantic UI
    return $jquery;
});
```

#### Use in controllers

[](#use-in-controllers-1)

Example of creating a Semantic-UI button

```
use Phalcon\Mvc\Controller;
use Ajax\php\phalcon\JsUtils;
/**
 * @property JsUtils $jquery
 */
class ExempleController extends Controller{
	public function indexAction(){
		$semantic=$this->jquery->semantic();
		$button=$semantic->htmlButton("btTest","Test Button");
		echo $button;
	}
}
```

### [![](https://camo.githubusercontent.com/6c4c0dbb0d67d8e1b96ce71d6de700ed6e90a61df6cd6afb0adce750d9fb975f/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f63692e706e67)](https://camo.githubusercontent.com/6c4c0dbb0d67d8e1b96ce71d6de700ed6e90a61df6cd6afb0adce750d9fb975f/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f63692e706e67) CodeIgniter configuration

[](#-codeigniter-configuration)

#### Library loading

[](#library-loading-3)

If you want CodeIgniter to use a Composer auto-loader, just set `$config['composer_autoload']` to `TRUE` or a custom path in **application/config/config.php**.

Then, it's necessary to create a library for the JsUtils class

##### Library creation

[](#library-creation)

Create the library **XsUtils** (the name is free) in the folder **application/libraries**

```
use Ajax\php\ci\JsUtils;
class XsUtils extends Ajax\php\ci\JsUtils{
	public function __construct(){
		parent::__construct(["semantic"=>true,"debug"=>false]);
	}
}
```

#### Injection of the service

[](#injection-of-the-service-1)

Add the loading of the **XsUtils** library in the file **application/config/autoload.php**

The jquery member will be accessible in the controllers

```
$autoload['libraries'] = array('XsUtils' => 'jquery');
```

Once loaded you can access your class in controllers using the **$jquery** member:

```
$this->jquery->some_method();
```

### [![](https://camo.githubusercontent.com/5389682590a36bfe0d16d8ca82d44bda99684353e28679294e6b530caffde18f/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f6c61726176656c2e706e67)](https://camo.githubusercontent.com/5389682590a36bfe0d16d8ca82d44bda99684353e28679294e6b530caffde18f/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f6c61726176656c2e706e67) Laravel configuration

[](#-laravel-configuration)

#### Library loading

[](#library-loading-4)

If you do not use the Composer autoloader file, you can also load phpMv-UI with composer.json :

```
"autoload": {
    "classmap": [
        ...
    ],
    "psr-4": {
        "Ajax\\": "vendor/phpmv/php-mv-ui/Ajax"
    }
},
```

#### Injection of the service

[](#injection-of-the-service-2)

Register a Singleton in **bootstrap/app.php** file :

```
$app->singleton(Ajax\php\laravel\JsUtils::class, function($app){
	$result= new Ajax\php\laravel\JsUtils();
	$result->semantic(new Ajax\Semantic());
	return $result;
});
```

Then it is possible to inject the **JsUtils** class in the base class controllers constructor :

```
use Ajax\php\laravel\JsUtils;
class Controller extends BaseController{
    use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests;
    protected $jquery;

    public function __construct(JsUtils $js){
    	$this->jquery = $js;
    }

    public function getJquery() {
    	return $this->jquery;
    }
}
```

### [![](https://camo.githubusercontent.com/b63e5a788ba5a50f9b5c96187bc8792e09b91b040135c6504158fb906055e0d8/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f7969692e706e67)](https://camo.githubusercontent.com/b63e5a788ba5a50f9b5c96187bc8792e09b91b040135c6504158fb906055e0d8/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f7969692e706e67) Yii configuration

[](#-yii-configuration)

#### Library loading

[](#library-loading-5)

The classes in the installed Composer packages can be autoloaded using the Composer autoloader. Make sure the entry script of your application contains the following lines to install the Composer autoloader:

```
require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
```

In the same file, register a new dependency :

```
\Yii::$container->setSingleton("Ajax\php\yii\JsUtils",["bootstrap"=>new Ajax\Semantic()]);
```

#### Injection of the service

[](#injection-of-the-service-3)

The **JsUtils** singleton can then be injected into controllers

```
namespace app\controllers;

use yii\web\Controller;
use Ajax\php\yii\JsUtils;

class SiteController extends Controller{
	protected $jquery;

	public function __construct($id, $module,JsUtils $js){
		parent::__construct($id, $module);
		$this->jquery=$js;
	}
}
```

### [![](https://camo.githubusercontent.com/fe72d4d6847264cffcf6179f27979353c703797def9f24bea74a5ce2f3302b95/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f73796d666f6e792e706e67)](https://camo.githubusercontent.com/fe72d4d6847264cffcf6179f27979353c703797def9f24bea74a5ce2f3302b95/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f73796d666f6e792e706e67) Symfony configuration

[](#-symfony-configuration)

#### Library loading

[](#library-loading-6)

If you do not use the Composer autoloader file, you can also load phpMv-UI with [Ps4ClassLoader](http://symfony.com/doc/current/components/class_loader/psr4_class_loader.html) :

```
use Symfony\Component\ClassLoader\Psr4ClassLoader;

require __DIR__.'/lib/ClassLoader/Psr4ClassLoader.php';

$loader = new Psr4ClassLoader();
$loader->addPrefix('Ajax\\', __DIR__.'/lib/phpmv/php-mv-ui/Ajax');
$loader->register();
```

#### Symfony 4

[](#symfony-4)

Create a service inheriting from `JquerySemantic`

```
namespace App\Services\semantic;

use Ajax\php\symfony\JquerySemantic;

class SemanticGui extends JquerySemantic{
}
```

Check that autowiring is activated in **config/services.yml**:

```
services:
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
```

You can then use dependency injection on properties, constructors or setters:

```
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use App\Services\semantic\SemanticGui;

BarController extends AbstractController{
	/**
	 * @var SemanticGui
	 */
	protected $gui;

    public function loadViewWithAjaxButtonAction(){
    	$bt=$this->gui->semantic()->htmlButton('button1','a button');
    	$bt->getOnClick("/url",'#responseElement');
    	return $this->gui->renderView("barView.html.twig");
    }
}
```

#### Symfony 3

[](#symfony-3)

##### Injection of the service

[](#injection-of-the-service-4)

Create 2 services in the **app/config/services.yml** file :

- The first for the JsUtils instance
- The second for the controller

```
parameters:
    jquery.params:
        semantic: true
services:
    jquery:
        class: Ajax\php\symfony\JsUtils
        arguments: [%jquery.params%,'@router']
        scope: request
    app.default_controller:
        class: AppBundle\Controller\DefaultController
        arguments: ['@service_container','@jquery']
```

It is then possible to inject the Symfony container and the JsUtils service in the controller constructor :

```
namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Ajax\php\symfony\JsUtils;
use AppBundle\AppBundle;

/**
 * @Route(service="app.default_controller")
 */
class DefaultController extends Controller{
	/**
	 * @var Ajax\php\symfony\JsUtils
	 */
	protected $jquery;

	public function __construct(ContainerInterface $container,JsUtils $js){
		$this->container=$container;
		$this->jquery= $js;
	}
}
```

### [![](https://camo.githubusercontent.com/2c5bd40ab3b039fca0a6ed1de425087a77634837ba6f9f25573c12b6470cf8ef/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f63616b657068702e706e67)](https://camo.githubusercontent.com/2c5bd40ab3b039fca0a6ed1de425087a77634837ba6f9f25573c12b6470cf8ef/687474703a2f2f616e67756c61722e6b6f626a6563742e6e65742f6769742f696d616765732f63616b657068702e706e67) CakePhp configuration

[](#-cakephp-configuration)

#### Component creation

[](#component-creation)

Copy the file **JsUtilsComponent.php** located in **vendor/phpmv/php-mv-ui/Ajax/php/cakephp** to the **src/controller/component** folder of your project

#### Component loading in controllers

[](#component-loading-in-controllers)

Add the **JsUtils** component loading in the initialize method of the base controller **AppController**, located in **src/controller/appController.php**

```
    public function initialize(){
        parent::initialize();

        $this->loadComponent('RequestHandler');
        $this->loadComponent('Flash');
        $this->loadComponent('JsUtils',["semantic"=>true]);
    }
```

#### Usage

[](#usage)

the jquery object in controller will be accessible on `$this->JsUtils->jquery`

Code completion in IDE
----------------------

[](#code-completion-in-ide)

With most IDEs (such as Eclipse or phpStorm), to get code completion on the `$jquery` instance, you must add the following property in the controller documentation:

```
/**
  * @property Ajax\JsUtils $jquery
  */
class MyController{
}
```

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity37

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~179 days

Total

74

Last Release

112d ago

PHP version history (3 changes)v2.0-alphaPHP &gt;5.3.9

2.3.0PHP &gt;7.0

2.4.17PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2511052?v=4)[Jean-Christophe HERON](/maintainers/jcheron)[@jcheron](https://github.com/jcheron)

---

Top Contributors

[![jcheron](https://avatars.githubusercontent.com/u/2511052?v=4)](https://github.com/jcheron "jcheron (580 commits)")

---

Tags

component-libraryjqueryphpphp-frameworkphp-libraryphp-mvc-frameworkphpmvsemantic-uitwitter-bootstrapuiphpsymfonyframeworklaravelcodeigniterjqueryyiiphalconsemantic uitwitter bootstrapjQuery UIubiquity

### Embed Badge

![Health badge](/badges/phpmv-php-mv-ui/health.svg)

```
[![Health](https://phpackages.com/badges/phpmv-php-mv-ui/health.svg)](https://phpackages.com/packages/phpmv-php-mv-ui)
```

###  Alternatives

[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.2M74](/packages/dragon-code-support)[pestphp/pest-plugin-laravel

The Pest Laravel Plugin

21941.1M6.5k](/packages/pestphp-pest-plugin-laravel)[phphleb/webrotor

Asynchronous PHP web server for shared hosting

631.5k1](/packages/phphleb-webrotor)[kompo/kompo

Laravel &amp; Vue.js FullStack Components for Rapid Application Development

11911.8k15](/packages/kompo-kompo)[gdg-tangier/cloud-pubsub

Google Cloud pub-sub for laravel

5054.0k](/packages/gdg-tangier-cloud-pubsub)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
