How to use my constants in Larvel
使用最後一個回答的解法,修改以下兩個檔案

<?php
//file : app/start/global.php

require app_path().'/constants.php';

還有

<?php
//file : app/constants.php

define('ADMIN',  'administrator');

然後就可以在其他檔案裡直接 echo ADMIN; //出來就是 administrator 囉

Comments

comments powered by Disqus
Copyright © 2013 Andro Chen
Powered by Logdown and Greyshade
Favicon from The Noun Project