lumen在哪里设置自定义函数?

WBOY
Release: 2016-06-06 20:24:53
Original
1574 people have browsed it

如题

Lumen框架,在哪里设置自定义函数?
或者
app目录里,设置了functions.php
去哪里加载?

回复内容:

如题

Lumen框架,在哪里设置自定义函数?
或者
app目录里,设置了functions.php
去哪里加载?

搞定:

bootstrap/app.php

<code>require_once __DIR__.'/../app/Lib/functions.php';</code>
Copy after login

比较好的方式是用composer

全局性的函数可以通过autoload引入,一般的工具函数可以封装在一个工具类里通过命名空间引入

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template