定制 xiaolin/ufa 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xiaolin/ufa

Composer 安装命令:

composer require xiaolin/ufa

包简介

README 文档

README

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

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 & 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:

<!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.

API List

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

  • 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.

  • getParams()

Get all parameters.# ufa

ufa

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2017-11-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固