PHPackages                             xiaolin/ufa - 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. xiaolin/ufa

ActiveLibrary

xiaolin/ufa
===========

0.0.1(8y ago)08proprietaryPHPPHP &gt;=5.6.4

Since Nov 21Pushed 8y agoCompare

[ Source](https://github.com/missxiaolin/ufa)[ Packagist](https://packagist.org/packages/xiaolin/ufa)[ RSS](/packages/xiaolin-ufa/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

UFA Introduction
================

[](#ufa-introduction)

UFA: Uniform Frontend Archiecture. A PHP composer plugin. 1

How to use?
===========

[](#how-to-use)

1. To add it in your `composer.json`.

```
{
    "require": {
        "xiaolin/ufa": "0.3.*",
    },
    "repositories": {
        // "ufa": {
            // "type": "git",
            // "url": "git@git.corp.angejia.com:frontend/ufa.git"
        // }
    }
}

```

If this step success, you can find the `vendor/angejia/ufa/` folder under your project.

1. To add ufa as a service in your `config/app.php`.

```
return [
    'providers' => [
        ...

        `Angejia\Ufa\Providers\UfaServiceProvider::class,`

        ...
    ]
]

```

After this step, you can use it anywhere without error, such as `ufa()->extJs()` or `ufa()->extCss()` .etc.

Note: although it has no error but it still do nothing in your html. In other words, it doesn't include any styles or scripts when your page loading. It won't work, unless you finish next step.

1. To add ufa views in your `config/view.php` and include `ufa styles` &amp; `ufa scripts` in your HTML blade view.

```
return [
   'paths' => [
       realpath(base_path('resources/views')),// default
       realpath(base_path('../vendor/angejia/ufa/src/views'))//ufa views folder
   ],
]

```

Add `ufa styles` and `ufa/scripts`, for example:

```

        @include('resources.styles')

        @include('resources.styles')

```

And untill now, the `ufa()->extJs` and `ufa()->extCss` works as you expected.

API List
========

[](#api-list)

You can use all the following function as this: `ufa()->asset('image/home.jpg')`.

- **`extJs($data = [])`**

```
