我只是想跑HTML源代碼,但是當我進入的HTML源 代碼到我的文字區域,並運行它,它僅顯示htmlcode作爲一個字符串 ,但我想運行代碼...............................無法在laravel運行HTML代碼
查看頁面
@extends('layouts.theme')
@section('content')
<div class="col-sm-8 col-sm-offset-2" style="border: 1px solid #ccc;">
<form class="form-horizontal login-form" method="post" name="loginFrm" id="loginFrm">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="f" class="col-sm-3 control-label"></label>
<div class="col-sm-12">
<textarea name="txtinput" placeholder="Paste your html code here" class="col-sm-12" rows="20"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<button type="submit" name="subBtn" class="btn btn-info pull-right">Format and Analyze</button>
</div>
</div>
</form>
</div>
<div style="clear:both"></div>
<div>
@if(count($htmlpagedata)>0)
{{ htmlentities($htmlpagedata) }}
@endif
</div>
@stop
控制器
<?php
namespace App\Http\Controllers;
use App\Http\Requests;
use Illuminate\Http\Request;
class JHtmlParsing extends Controller {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return view('input');
}
/**
* Parse HTML Page.
*
* @return Response
*/
public function parsehtml(Request $request)
{
$data=$request->get('txtinput');
return view('input')->with('htmlpagedata',$data);
}
}
請包括有關該問題的更多詳細信息。從你的問題來看你的問題並不完全清楚(兩個單獨的答案證明了這一點)。 – Styphon