Learning Laravel 4 Application Development 堪误

本文详细列举了《学习 Laravel》一书中存在的代码错误,并提供了正确的修正方案,帮助读者避免常见的编程陷阱,提升学习效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 这本书的错误还真不少。

 

Errata

- 12 submitted: last submission 04 Sep 2014

Errata Type: Code | Page number: 29

$ php artisan controller make:user

should be replaced with

$ php artisan controller:make user

 

Errata Type: code | Page number: 35

Route::get('contact', 'Pages@contact');

should be

Route::get('contact', 'PagesController@contact');

Errata Type: Code | Page number: 39


$ php artisan Usercontroller:make users

should be replaced with

$ php artisan controller:make UserController

This will generate "UsersController.php" with all
应改为 "UserController.php"

Errata type: Code| Page Number: 42

 

@extends('users.user')

should be inserted before

@section('main')

Errata Type: Code | Page Number: 44

Laravel will load the users.blade.php layout

should be replaced with


Laravel will load the user.blade.php layout

 

 

Errata Type: Code | Page Number: 45

 

@extends('layouts.users')

should be replaced with
@extends('users.user')

Errata Type: Code | Page Number: 48

protected $guarded = array('id');

should be replaced with


protected $guarded = array('id','password_confirmation');

Errata Type: Code | Page Number: 50

@extends('users.scaffold')

should be replaced with:

@extends('
users.user')

 

 

Errata Type: Code | Page number: 51

return Redirect::route('users.show', $id);

should be replaced with

 return Redirect::route('users.index');

 

Errata Type: Code | Page number: 53

{{ echo $users->links(); }}

should be replaced with

{{  $users->links(); }}

 

Errata Type: Code | Page number: 60

DB::table('users')->insert(
array('username'=>'James','email' => 'james@gmail.
com','password'=>$hashed),
array('username'=>'Steve','email' => 'stever@yahoo.
com','password'=>$hashed)

should be replaced with

DB::table('users')->insert(array(
array('username'=>'James','email' => 'james@gmail.
com','password'=>$hashed),
array('username'=>'Steve','email' => 'stever@yahoo.
com','password'=>$hashed)

 

 

Errata Type: Code | Page Number: 72

Route::get('/about', function()
{
return View::make('about')->with('title','About
Foldagram')->with('page','about');
});

should be replaced with

Route::get('/about', array('as' => 'about', function()
{
 return View::make('about')->with('title','About Foldagram')->with('class','about');
}));

 

Errata Type: Code | Page number: 74

@endsection

should be replaced by

@stop

 

Errata Type: Code | Page number : 90

$ php artisan workbench Acme/Cart –resources

shoud be:

$ php artisan workbench Acme/Cart --resources 

 

https://www.packtpub.com/books/content/support/15860

 

http://www.jianshu.com/p/50892fac6cbc

 

http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_cn/

 

http://www.salttiger.com/category/notification/

http://www.ebookee.net/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值