Evercode1\ViewMaker\CommonTemplates::commonChildCreateTemplate PHP Метод

commonChildCreateTemplate() публичный Метод

    public function commonChildCreateTemplate()
    {
        $content = <<<EOD
@extends('layouts.:::masterPage:::')

@section('title')

    <title>Create a :::upperCaseModelName:::</title>

@endsection

@section('content')

        <ol class='breadcrumb'><li><a href='/'>Home</a></li><li><a href=':::modelRoute:::'>:::modelsUpperCase:::</a></li><li class='active'>Create</li></ol>

        <h2>Create a New :::upperCaseModelName:::</h2>

        <hr/>


        <form class="form" role="form" method="POST" action="{{ url(':::modelRoute:::') }}">

        {!! csrf_field() !!}

        <!-- :::field_name::: Form Input -->
            <div class="form-group{{ \$errors->has(':::field_name:::') ? ' has-error' : '' }}">
                <label class="control-label">:::upperCaseModelName::: Name</label>

                    <input type="text" class="form-control" name=":::field_name:::" value="{{ old(':::field_name:::') }}">

                    @if (\$errors->has(':::field_name:::'))
                        <span class="help-block">
                                        <strong>{{ \$errors->first(':::field_name:::') }}</strong>
                                    </span>
                    @endif

            </div>

            <div class="form-group{{ \$errors->has(':::parent_id:::') ? ' has-error' : '' }}">

   <label for=":::parent_id:::">:::parent::: Name:</label>
   <select class="form-control" name=":::parent_id:::">

   <option value="">Please Choose One</option>

   @foreach(\$:::parentInstances::: as \$:::parentInstance:::)

       <option value="{{ \$:::parentInstance:::->id }}">{{ \$:::parentInstance:::->:::parentFieldName::: }}</option>

       @endforeach

       </select>



   @if (\$errors->has(':::parent_id:::'))
       <span class="help-block">
                           <strong>{{ \$errors->first(':::parent_id:::') }}</strong>
                       </span>
   @endif



</div>


            <div class="form-group">
                    <button type="submit" class="btn btn-primary btn-lg">
                        Create
                    </button>
            </div>

        </form>

@endsection
EOD;
        return $this->tokens->formatTokens($content);
    }