0
我正在使用laravel 5.2,並且正在開發項目管理工具。在我的應用程序中,我有項目,每個項目都有任務,一個任務可能有子任務。在每一個任務我有按鈕,創建子任務,如下圖所示如何在Laravel 5.2中路由子任務URL?
<a href="" class="editInline"><i class="glyphicon glyphicon-plus"></i></a>
時,我認爲我的任務列表女巫與每個項目我的網址如下。
http://localhost:8000/projects/1
現在我有鑑於文件的子任務文件夾的子任務的形式進入子任務,每個任務
subtasks/subtask.blade.php
現在我需要當我點擊子任務進入按鈕重定向子任務刀片文件的URL是這樣的辦法。
http://localhost:8000/projects/1/task/1/subtask
我如何管理的子任務的HREF添加按鈕
<a href="" class="editInline"><i class="glyphicon glyphicon-plus"></i></a>
和我的路線? 更新 這是我的子任務的輸入形式
<form class="form-vertical" role="form" method="post" action="{{ route('projects/{projectId}/task/{taskId}/subtask')}}">
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<input type="text" name="task_name" class="form-control" id="name" value="{{ old('task_name') ?: '' }}">
@if ($errors->has('task_name'))
<span class="help-block">{{ $errors->first('task_name') }}</span>
@endif
</div>
<div class="form-group">
<button type="submit" class="btn btn-info">Create Task</button>
</div>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</form>
是我的子任務形式的行動是否正確?
尚未開發控制器呢...... – Lilan
更新了我的答案 – iCoders
好吧,它工作正常。 – Lilan