douyun7718 2015-10-20 02:04
浏览 33

FormFacade不在刀片L5中输出形式

I have in my composer.json

"illuminate/html": "^5.0"

I did a composer dump-autoload so all is well there.

In my app.config, I have in my providers section:

Illuminate\Html\HtmlServiceProvider::class,

In my aliases section I have:

    'Form'      => Illuminate\Html\FormFacade::class,
    'Html'      => Illuminate\Html\HtmlFacade::class,

If I go to tinker and type Form::open(), predictably I get:

<form method="POST" action="http://localhost" accept-charset="UTF-8"><input name="_token" type="hidden">

However, in my blade page, if I do a:

        {!! Form::open() !!}

        {!! Form::close() !!}

I see those words on the page! I hate to ask such a stupid question but how can I get this to work within my blade page?

  • 写回答

2条回答 默认 最新

  • doubi1797 2015-10-20 02:21
    关注

    When I put the Form tags on a blade page

    {!! Form::open() !!}
    {!! Form::close() !!}
    

    The source html source is

    <form method="POST" action="http://localhost/test" accept-charset="UTF-8">
        <input name="_token" type="hidden" value="zgd8BaZDnnDeF6qFdODQM9tjwmBOWgQp1bAHqMWY">
    </form>
    

    composer.json

    "require": {
       "illuminate/html": "~5.0"
    }
    

    config/app.php

    'providers' => [
       Illuminate\Html\HtmlServiceProvider::class,
     ],
    'aliases' => [
       'Form' => Illuminate\Html\FormFacade::class,
       'Html' => Illuminate\Html\HtmlFacade::class,
    ]
    

    I have an alias for caching issues that I like to use

    alias cleanslate='artisan cache:clear;artisan clear-compiled;composer dump-autoload;rm -fv ./storage/framework/views/*'
    

    a combination of

    artisan cache:clear;
    artisan clear-compiled;
    composer dump-autoload;
    rm -fv ./storage/framework/views/*;
    

    Which can help get rid of weird problems.

    The only other thing I can think of is to run composer update and/or composer install

    Edit

    There are a few things you could try.

    1. Make the storage directory writable.

      chmod 777 -R ./storage

    2. Run a diff on the app directory of both project, the one that works and the one that doesn't and make any adjustments as needed.

    3. Copy all of your source into the project that works.

    评论

报告相同问题?

悬赏问题

  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)