Home  >  Article  >  Backend Development  >  lumen在哪里设置自定义函数?

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

WBOY
WBOYOriginal
2016-06-06 20:24:531501browse

如题

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

回复内容:

如题

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

搞定:

bootstrap/app.php

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

比较好的方式是用composer

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

Statement:
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