سؤال

Is it possible to have the master.blade.php file outside of the template files.

Example below:

views/
     master.blade.php
     layout/
           hello.blade.php

views/layout/hello.blade.php

@extends('layout.master)

I have tried the above but it cannot find the master.blade.php file. So is there a way to refer to a directory above the blade file.

هل كانت مفيدة؟

المحلول

it would be

@extends('master')

the "." in the view names indicate folders. so

@extends('my.long.path.to.template')

would be found in:

/views/my/long/path/to/template.blade.php

layouts don't have to be in a folder called layouts

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top