Can somebody explain why the next thing doesn't work in laravel 5.1: I've view file login1.blade.php
@extends('ajaxforms.form1')
@section('form')
<input type="text" name="email" /><input type="password" name="password" />
@endsection
@section('script')
<script type="text/javascript">var modalName = '#{{$modalname}}';</script>
@endsection
@section('link')
<li ng-controller="login_controller" id="login_controller">
<a href="#" data-toggle="modal" data-target="#{{$modalname}}">Sign in</a></li>
@endsection
register1.blade.php
@extends('ajaxforms.form1')
@section('form')
<input type="text" name="name" /><input type="text" name="email" />
<input type="password" name="password" /><input type="password2" name="password2" />
@endsection
@section('script')
<script type="text/javascript">var modalName = '#{{$modalname}}';</script>
@endsection
@section('link')
<li ng-controller="register_controller" id="register_controller">
<a href="#" data-toggle="modal" data-target="#{{$modalname}}">Sign in</a></li>
@endsection
..and form1.blade.php
<div id="{{ $modalname }}">
@yield('form')
</div>
@yield('script')
@yield('link')
And also links in a master.blade.php:
@include('ajaxforms.login1',['modalname' => 'modalLogin'])
@include('ajaxforms.register1', ['modalname' => 'modalRegister'])
This generates a code:
<div id="modalLogin">
<input type="text" name="email" /><input type="password" name="password" />
</div>
<script type="text/javascript">var modalName = '#modalLogin';</script>
<li ng-controller="login_controller" id="login_controller">
<a href="#" data-toggle="modal" data-target="#modalLogin">Sign in</a></li>
<div id="modalRegister">
<input type="text" name="email" /><input type="password" name="password" />
</div>
<!--Here I want to '#modalRegister' instead of '#modalLogin'; And register_controller
instead of login_controller. Why doesn't work?????????????????????????-->
<script type="text/javascript">var modalName = '#modalLogin';</script>
<li ng-controller="login_controller" id="login_controller">
<a href="#" data-toggle="modal" data-target="#modalLogin">Sign in</a></li>
Thank you
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire