Prepend and Append Files with?.htaccess

WBOY
リリース: 2016-06-06 20:09:18
オリジナル
1201 人が閲覧しました

One of the lessor known and used capabilities of .htaccess files is the ability to prepend and append includes to every page request. ?Doing so avoids needing to code ?php require('footer.php'); ? in every template file you wat to use them

One of the lessor known and used capabilities of .htaccess files is the ability to prepend and append includes to every page request. ?Doing so avoids needing to code <?php require('footer.php'); ?> in every template file you wat to use them in. ?Here’s the .htaccess code:

# Prepend the file
php_value auto_prepend_file "/dir/path/utilities.php"
# Append file to bottom of page
php_value auto_append_file "/dir/path/templates/footer.php"
ログイン後にコピー

Now don’t mistake this post as me telling you to use this strategy; ?using this functionality creates a layer of indirection that could confuse a team of developers if they don’t all have a grasp of where automatically included files are coming from. ?Just wanted to let you know this was possible!

Read the full article at: Prepend and Append Files with .htaccess

Treehouse

Sencha Conference

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のおすすめ
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!