Skip to content

Commit 462f88b

Browse files
authored
Update README.md
1 parent be69ce3 commit 462f88b

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
</a>
1313

1414

15-
##What's phpMv-UI ?
15+
## What's phpMv-UI ?
1616

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

1919
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.
2020

21-
##Requirements/Dependencies
21+
## Requirements/Dependencies
2222

2323
* PHP >= 5.3.9
2424
* JQuery >= 2.0.3
2525
* JQuery UI >= 1.10 [optional]
2626
* Twitter Bootstrap >= 3.3.2 [optional]
2727
* Semantic-UI >= 2.2 [optional]
2828

29-
##Resources
29+
## Resources
3030
* [API](http://api.kobject.net/phpMv-UI/)
3131
* [Documentation/demo](http://phpmv-ui.kobject.net/)
3232

33-
##I - Installation
33+
## I - Installation
3434

3535
### Installing via Composer
3636

@@ -62,16 +62,16 @@ Just clone the repository in a common location or inside your project:
6262
git clone https://github.com/phpMv/phpMv-UI.git
6363
```
6464

65-
##II PHP frameworks configuration
66-
###Library loading
65+
## II PHP frameworks configuration
66+
### Library loading
6767
phpMv-UI complies with [PSR-4 recommendations](http://www.php-fig.org/psr/psr-4/) for auto-loading classes.
6868
Whatever the php framework used, with "composer", it is enough to integrate the Composer autoload file.
6969
```php
7070
require_once("vendor/autoload.php");
7171
```
7272
### <img src="http://angular.kobject.net/git/images/phalcon.png" width="30"> Phalcon configuration
7373

74-
####Library loading
74+
#### Library loading
7575
Without Composer, It is possible to load the library with the **app/config/loader.php** file :
7676

7777
```php
@@ -81,7 +81,7 @@ $loader->registerNamespaces(array(
8181
))->register();
8282
```
8383

84-
####Injection of the service
84+
#### Injection of the service
8585

8686
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 :
8787
```php
@@ -92,7 +92,7 @@ $di->set("jquery",function(){
9292
});
9393
```
9494

95-
####Use in controllers
95+
#### Use in controllers
9696
Example of creating a Semantic-UI button
9797

9898
```php
@@ -111,12 +111,12 @@ class ExempleController extends Controller{
111111
```
112112

113113
### <img src="http://angular.kobject.net/git/images/ci.png" width="30"> CodeIgniter configuration
114-
####Library loading
114+
#### Library loading
115115
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**.
116116

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

119-
#####Library creation
119+
##### Library creation
120120
Create the library **XsUtils** (the name is free) in the folder **application/libraries**
121121

122122
```php
@@ -127,7 +127,7 @@ class XsUtils extends Ajax\php\ci\JsUtils{
127127
}
128128
}
129129
```
130-
####Injection of the service
130+
#### Injection of the service
131131
Add the loading of the **XsUtils** library in the file **application/config/autoload.php**
132132

133133
The jquery member will be accessible in the controllers
@@ -141,7 +141,7 @@ $this->jquery->some_method();
141141

142142
### ![](http://angular.kobject.net/git/images/laravel.png) Laravel configuration
143143

144-
####Library loading
144+
#### Library loading
145145
If you do not use the Composer autoloader file, you can also load phpMv-UI with composer.json :
146146

147147
```json
@@ -154,7 +154,7 @@ If you do not use the Composer autoloader file, you can also load phpMv-UI with
154154
}
155155
},
156156
```
157-
####Injection of the service
157+
#### Injection of the service
158158
Register a Singleton in **bootstrap/app.php** file :
159159

160160
```php
@@ -184,7 +184,7 @@ class Controller extends BaseController{
184184
```
185185
### <img src="http://angular.kobject.net/git/images/yii.png" width="30"> Yii configuration
186186

187-
####Library loading
187+
#### Library loading
188188
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:
189189
```php
190190
require(__DIR__ . '/../vendor/autoload.php');
@@ -194,7 +194,7 @@ In the same file, register a new dependency :
194194
```php
195195
\Yii::$container->setSingleton("Ajax\php\yii\JsUtils",["bootstrap"=>new Ajax\Semantic()]);
196196
```
197-
####Injection of the service
197+
#### Injection of the service
198198
The **JsUtils** singleton can then be injected into controllers
199199

200200
```php
@@ -215,7 +215,7 @@ class SiteController extends Controller{
215215

216216
### <img src="http://angular.kobject.net/git/images/symfony.png" width="30"> Symfony configuration
217217

218-
####Library loading
218+
#### Library loading
219219
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) :
220220

221221
```php
@@ -227,7 +227,7 @@ $loader = new Psr4ClassLoader();
227227
$loader->addPrefix('Ajax\\', __DIR__.'/lib/phpmv/php-mv-ui/Ajax');
228228
$loader->register();
229229
```
230-
####Injection of the service
230+
#### Injection of the service
231231
Create 2 services in the **app/config/services.yml** file :
232232
* The first for the JsUtils instance
233233
* The second for the controller
@@ -273,10 +273,10 @@ class DefaultController extends Controller{
273273
```
274274
### <img src="http://angular.kobject.net/git/images/cakephp.png" width="30"> CakePhp configuration
275275

276-
####Component creation
276+
#### Component creation
277277
Copy the file **JsUtilsComponent.php** located in **vendor/phpmv/php-mv-ui/Ajax/php/cakephp** to the **src/controller/component** folder of your project
278278

279-
####Component loading in controllers
279+
#### Component loading in controllers
280280
Add the **JsUtils** component loading in the initialize method of the base controller **AppController**, located in **src/controller/appController.php**
281281
```php
282282
public function initialize(){
@@ -287,7 +287,7 @@ Add the **JsUtils** component loading in the initialize method of the base contr
287287
$this->loadComponent('JsUtils',["semantic"=>true]);
288288
}
289289
```
290-
####Usage
290+
#### Usage
291291

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

0 commit comments

Comments
 (0)