最近、Laravel 5.1にハマっています。
Laravelは現在、最も注目されているPHPのフレームワークだと思います。
詳しくは、こちらで調べてみました。
PHPのフレームワーク動向
LaravelのBladeテンプレートFormのセレクトボックスで出てきたエラー
Laravelでは、ビュー(UI)の部分はbladeというテンプレートエンジンを使います。
以下のように、Formのselectを使って、セレクトボックスを作ってみました。
1 2 3 4 |
<div class="form-group"> {!! Form::label('tag_list', 'Tags:') !!} {!! Form::select('tag_list[]', $tags, null, ['class' => 'form-control', 'multiple']) !!} </div> |
するとどうでしょうか?
こんなエラーが出ました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
Whoops, looks like something went wrong. 1/1 FatalErrorException in Container.php line 1059: Maximum function nesting level of '100' reached, aborting! in Container.php line 1059 at FatalErrorException->__construct() in HandleExceptions.php line 133 at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 118 at HandleExceptions->handleShutdown() in HandleExceptions.php line 0 at Container->make() in Application.php line 674 at Application->make() in Container.php line 1159 at Container->offsetGet() in DatabaseManager.php line 251 at DatabaseManager->getDefaultConnection() in DatabaseManager.php line 85 at DatabaseManager->parseConnectionName() in DatabaseManager.php line 61 at DatabaseManager->connection() in Model.php line 3269 at Model::resolveConnection() in Model.php line 3235 at Model->getConnection() in Model.php line 2981 at Model->getDateFormat() in Model.php line 2914 at Model->fromDateTime() in Model.php line 2871 at Model->setAttribute() in Model.php line 422 at Model->fill() in Model.php line 445 at Model->Illuminate\Database\Eloquent\{closure}() in Model.php line 2314 at Model::unguarded() in Model.php line 446 at Model->forceFill() in Pivot.php line 58 at Pivot->__construct() in Model.php line 1944 at Model->newPivot() in BelongsToMany.php line 1126 at BelongsToMany->newPivot() in BelongsToMany.php line 1139 at BelongsToMany->newExistingPivot() in BelongsToMany.php line 257 at BelongsToMany->hydratePivotRelation() in BelongsToMany.php line 178 at BelongsToMany->get() in BelongsToMany.php line 99 at BelongsToMany->getResults() in Model.php line 2722 at Model->getRelationshipFromMethod() in Model.php line 2688 at Model->getRelationValue() in Model.php line 2630 at Model->getAttribute() in Model.php line 3384 at Model->__get() in Model.php line 41 at Article->getTagListAttribute() in Model.php line 2745 at Model->mutateAttribute() in Model.php line 2647 at Model->getAttributeValue() in Model.php line 3453 at Model->__isset() in FormBuilder.php line 3407 at Model->offsetExists() in FormBuilder.php line 419 at data_get() in FormBuilder.php line 1091 at FormBuilder->getModelValueAttribute() in FormBuilder.php line 1078 at FormBuilder->getValueAttribute() in FormBuilder.php line 525 at FormBuilder->select() in Facade.php line 225 at Facade::__callStatic() in 27de2e69b8935784d957c890334b9929 line 24 at FormFacade::select() in 27de2e69b8935784d957c890334b9929 line 24 in PhpEngine.php line 42 at PhpEngine->evaluatePath() in CompilerEngine.php line 58 at CompilerEngine->get() in View.php line 135 at View->getContents() in View.php line 106 at View->renderContents() in View.php line 80 at View->render() in 7900eb9b70f8b78d4d2d8a29018b33ff line 15 in PhpEngine.php line 42 at PhpEngine->evaluatePath() in CompilerEngine.php line 58 at CompilerEngine->get() in View.php line 135 at View->getContents() in View.php line 106 at View->renderContents() in View.php line 80 at View->render() in Response.php line 51 at Response->setContent() in Response.php line 198 at Response->__construct() in Router.php line 1229 at Router->prepareResponse() in ControllerDispatcher.php line 113 at ControllerDispatcher->Illuminate\Routing\{closure}() in Pipeline.php line 139 at call_user_func:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:139}() in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline\{closure}() in Authenticate.php line 26 at Authenticate->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103 at call_user_func:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103}() in Pipeline.php line 103 at Pipeline->then() in ControllerDispatcher.php line 114 at ControllerDispatcher->callWithinStack() in ControllerDispatcher.php line 69 at ControllerDispatcher->dispatch() in Route.php line 203 at Route->runWithCustomDispatcher() in Route.php line 134 at Route->run() in Router.php line 708 at Router->Illuminate\Routing\{closure}() in Pipeline.php line 139 at call_user_func:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:139}() in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103 at call_user_func:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103}() in Pipeline.php line 103 at Pipeline->then() in Router.php line 710 at Router->runRouteWithinStack() in Router.php line 675 at Router->dispatchToRoute() in Router.php line 635 at Router->dispatch() in Kernel.php line 236 at Kernel->Illuminate\Foundation\Http\{closure}() in Pipeline.php line 139 at call_user_func:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:139}() in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline\{closure}() in VerifyCsrfToken.php line 50 at VerifyCsrfToken->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in StartSession.php line 62 at StartSession->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in EncryptCookies.php line 59 at EncryptCookies->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in CheckForMaintenanceMode.php line 44 at CheckForMaintenanceMode->handle() in Pipeline.php line 124 at call_user_func_array:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124}() in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103 at call_user_func:{C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103}() in Pipeline.php line 103 at Pipeline->then() in Kernel.php line 122 at Kernel->sendRequestThroughRouter() in Kernel.php line 87 at Kernel->handle() in index.php line 54 in server.php line 21 at {main}() in server.php line 0 |
うーん。。
Laravelは、便利なんですが、日本におけるユーザー人口が少ないために、まだ解説書が少ないです。
LaravelをIDE、統合開発環境で使うには
有償版ですが、PhpStormが最も優れたPHPのIDEです。
以下の画面の通り設定すると、PhpStormでLaravel 5.1が使えるようになります。
無償版なら、NetBeansが良いです。PhpStormよりは少し性能が劣りますが、十分使えます。
Laravelの便利な日本語解説書、WEBサイト
現時点では、以下の本が唯一でかつ、もっとも適した日本語の解説書です。
Laravel リファレンス[Ver.5.1 LTS 対応] Web職人好みの新世代PHPフレームワーク
また、以下のサイトが最も優れたLaravelの学習サイトだと思います。
ララ帳 PHPフレームワークLaravelの学習帳
コメント