문제

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