在Laravel中使用`.`而不是`/`。

huangapple go评论67阅读模式
英文:

using . instead of / in laravel

问题

我学习 Laravel,我发现在扩展视图时,我们使用'.'而不是'/'。

示例:@extends('layouts.nav')

我的问题是为什么我们使用'.'而不是'/',当我使用'/'而不是'.'时,它也能正常工作。

英文:

I learn laravel and I see that when we extend a view we use '.' instead of '/'

example: @extends('layouts.nav')

my question is why do we use '.' instead of '/' and when I used '/' instead of '.' it did the same work

答案1

得分: 0

建议使用点表示法而不是斜杠(/)。虽然文件中没有明确说明,但斜杠(/)通常用作路径分隔符,在某些情况下可能会导致错误。您可以在 Laravel 文档1 中查看更多信息。

英文:

It's better to use dot notation instead of '/'. It's not written in the documents but '/' is used for path separator and in some cases it might return some kind of an error. You can check the laravel docs here.

huangapple
  • 本文由 发表于 2023年2月16日 17:29:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470215.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定