Laravelにはプロジェクト内の各ディレクトリのパスを取得できるヘルパー関数がいくつかあります。この記事ではその取得方法を紹介します。
取得方法
echo "app_path : " . app_path() . "\n";
echo "base_path : " . base_path() . "\n";
echo "config_path : " . config_path() . "\n";
echo "database_path : " . database_path() . "\n";
echo "lang_path : " . lang_path(). . "\n";
echo "public_path : " . public_path() . "\n";
echo "resource_path : " . resource_path() . "\n";
echo "storage_path : " . storage_path() . "\n";
app_path : /var/www/html/app
base_path : /var/www/html
config_path : /var/www/config
database_path : /var/www/database
lang_path : /var/www/html/lang
public_path : /var/www/public
resource_path : /var/www/resources
storage_path : /var/www/storage
参考
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing ...
コメント