@codenaki

Использование Blade templates, почему не работает?

Нужно задействовать модальное окно , нужно таких несколько поэтому решил использовать section и yield ..
Не пойму что не хватает ?

<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                        <div class="header-inner-img">
                            <img src="{{asset('images/news/north-1.jpg')}}" class="img-thumbnail">
                            <div class="advertisement">
                                <a href=""><button class="btn btn-info" data-toggle="modal" data-target="#news-modal"><span>Check it ..</span></button></a>
                                <p>Some text news</p>
                                @yield('modal')
                            </div>
                        </div>
                    </div>


@extends('news')

@section('modal')
    <div class="modal fade" role="dialog" aria-labelledby="first" id="news-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="first">Advertisement topic!</h4>
                </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                        <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                        <p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
                    </div>
                </div>
            </div>
             <div class="modal-footer">
                <button type="button" class="btn btn-info" data-dismiss="modal">Close</button>
             </div>
          </div>
        </div>
    </div>
@endsection


Структура :
5a3e9321d9382730184441.png
  • Вопрос задан
  • 95 просмотров
Пригласить эксперта
Ответы на вопрос 1
zorca
@zorca
Нужно так (это только поправит путь к файлу):
@extends('includes.news-modals')
И переименовать news.modals.blade.php в news-modals.blade.php.
Но, судя по структуре и коду, налицо неверное понимание принципа наследования. В данном случае нужен просто инклюд судя по всему. Подпишите код, из каких файлов он взят.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы