2017 © Pedro Peláez
 

library ufa

image

xiaolin/ufa

  • Monday, April 9, 2018
  • by missxiaolin
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

UFA Introduction

UFA: Uniform Frontend Archiecture. A PHP composer plugin. 1, (*1)

How to use?

  1. To add it in your composer.json., (*2)

    {
     "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., (*3)

  2. To add ufa as a service in your config/app.php., (*4)

    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., (*5)

    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., (*6)

  3. To add ufa views in your config/view.php and include ufa styles & ufa scripts in your HTML blade view., (*7)

    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:, (*8)

    <!DOCTYPE html>
    <html>
     <head>
         @include('resources.styles')
     </head>
     <body>
         <!-- main content -->
         @include('resources.styles')
     </body>    
    </html>
    

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

API List

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

  • extJs($data = [])
<?php
ufa()->extJs([
    'home.js',
    '../lib/jquery.js'
])
  • extCss($data = [])
<?php
ufa()->extJs([
    'home.css',
    '../lib/jquery-ui.css'
])
  • asset($data = [])
<div>
    <img src="{{ufa()->asset('image/logo.png')}}"/>
</div>
  • addParam($value = [], $key = '')
<?php
ufa()->addParam(['count' => $count, 'pagename' => $page_name]);
  • getParam($key)

Get single parameter., (*11)

  • getParams()

Get all parameters.# ufa, (*12)

ufa

The Versions

09/04 2018

dev-master

9999999-dev

  Sources   Download

proprietary

The Requires

 

21/11 2017

0.0.1

0.0.1.0

  Sources   Download

proprietary

The Requires