teepluss/component
最新稳定版本:1.0.1
Composer 安装命令:
composer require teepluss/component
包简介
Component is used to separate small parts from the main view and still works perfectly.
README 文档
README
Component is used to separate small parts from the main view and still works perfectly.
Installation
Composer
To get the latest version of Theme simply require it in your composer.json file.
"teepluss/component": "dev-master"
You'll then need to run composer update to download it and have the autoloader updated.
Laravel
In your config/app.php add 'Teepluss\Component\ComponentServiceProvider' to the end of the providers array:
'providers' => [ ... 'Teepluss\Component\ComponentServiceProvider', ]
Publish Configuration
php artisan vendor:publish --provider="Teepluss\Component\ComponentServiceProvider"
Usage
Create a Component
Using artisan CLI to create a component, then you can found your component into app/Components.
php artisan component:make LiveChatBox
The command will generate a structure like this:
root |- app |--- Components |----- LiveChatbox |------- assets |--------- css |------------ style.css |--------- img |--------- js |------------ script.js |------- lang |--------- en |------------ messages.php |------- views |--------- index.blade.php |------- LiveChatbox.php |----- gulp.js
Render a component.
{!! component()->uses('LiveChatBox', ['args' => '1'])->render() !!}
Working with assets.
Install gulp
npm install gulp
Using gulp to publish component assets.
$ cd app/Components/
$ gulp
$ gulp watch
Render all component scripts and styles from the main layout
// Display component scripts and styles.
{!! component()->scripts() !!}
{!! component()->styles() !!}
// Locate to asset path.
{!! component()->uses('LiveChatBox')->asset('img/someimage.png') !!}
Translation
{!! component()->trans('message') !!}
Support or Contact
If you have some problem, Contact teepluss@gmail.com
统计信息
- 总下载量: 224
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-07