PHP的Laravel框架中使用AdminLTE模板来编写网站后台(3)

<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; class TestController extends Controller { public function index() { $data['tasks'] = [ [ 'name' => 'Design New Dashboard', 'progress' => '87', 'color' => 'danger' ], [ 'name' => 'Create Home Page', 'progress' => '76', 'color' => 'warning' ], [ 'name' => 'Some Other Task', 'progress' => '32', 'color' => 'success' ], [ 'name' => 'Start Building Website', 'progress' => '56', 'color' => 'info' ], [ 'name' => 'Develop an Awesome Algorithm', 'progress' => '10', 'color' => 'success' ] ]; return view('test')->with($data); } }

3.创建对应的路由

Route::get('test', 'TestController@index');

4.打开对应的页面,如果你没有出错的 应该如下图所示

2016321174155654.jpg (800×472)

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/59a24e86799d65402f6cc28ef740ed55.html