在 .phtml 文件中,是否可以执行以下操作?<?php use App\Library as Lib; ?>
<h3><?php Lib::getTitle(); ?></h3>....
我有一个 .phtml 文件,它使用 Utility 类来制作下拉菜单等等,不想为所有内容输入整个命名空间。
在此先感谢您的帮助。
最佳答案
如果你像这样配置你的服务器,使用 .phtml
文件应该与使用 .php
严格相同文件。
See this question (如果您正在运行 Apache)。
关于html - 是否可以将 'use as' 用于 .phtml 文件中的命名空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29241408/