jackpopp/tura 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jackpopp/tura

Composer 安装命令:

composer require jackpopp/tura

包简介

Tura - use laravel named routes in your javascript.

README 文档

README

Use laravel named routes in your javascript.

Register named routes in routes.php and add they key tura with the value true to the options array. Tura will only expose routes which have been set to be exposed.

Route::get('/', array(
    'uses' => 'HomeController@index',
    'as'   => 'home',
    'tura' => true
));

Route::get('user', array(
    'uses' => 'HomeController@index',
    'as'   => 'user.create'
));

Route::get('user/{id}', array(
    'uses' => 'HomeController@index',
    'as'   => 'user.show',
    'tura' => true
));

You can now access your exposed named routes as a JSON object by calling the fetch routes method (this could be called in your master blade layout for example).

Tura::fetchRoutes();

The named routes will now be available in the javascript global scope by calling the tura object

console.log(tura)
Object {home: "/", user.show: "user/{id}"}
console.log(tura['user.show'])
"user/{id}"

Install via composer add to require in composer.json

"jackpopp/tura": "dev-master"

Add the service provider and class alias to app.php config (found in app/config/app.php)

Add to the providers array

'Jackpopp\Tura\TuraServiceProvider',

Add to the aliases array

'Tura' => 'Jackpopp\Tura\TuraServiceProvider',

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固