phpMv  -UI toolkit 2.2.2
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
phpMv Documentation
php-mv-UI

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

phpMv-UI website

What's 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

  • PHP >= 5.3.9
  • JQuery >= 2.0.3
  • JQuery UI >= 1.10 [optional]
  • Twitter Bootstrap >= 3.3.2 [optional]
  • Semantic-UI >= 2.2 [optional]

Resources

I - Installation

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.x-dev"
}
}

In the app directory, run the composer installer :

php composer.phar install

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

Library loading

phpMv-UI complies with PSR-4 recommendations 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");

Phalcon configuration

Library loading

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

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

Example of creating a Semantic-UI button

```php use Phalcon; use Ajax; /**