Created
June 3, 2014 09:19
-
-
Save syossan27/2e204eadd43917eb2b09 to your computer and use it in GitHub Desktop.
Laravelでお手製ライブラリを使いたい時のTips ref: http://qiita.com/syossan27/items/c69acc3044424a210932
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir libraries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClassLoader::addDirectories(array( | |
app_path().'/commands', | |
app_path().'/controllers', | |
app_path().'/models', | |
app_path().'/database/seeds', | |
app_path().'/libraries' ←追加! | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"autoload": { | |
"classmap": [ | |
"app/commands", | |
"app/controllers", | |
"app/models", | |
"app/database/migrations", | |
"app/database/seeds", | |
"app/tests/TestCase.php", | |
"app/libraries" ←追加! | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Helper | |
{ | |
public static function test(){ | |
print_r("テストだよ!"); | |
Log::debug("テストだよ!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index(){ | |
Helper::test(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment