Heim > php教程 > php手册 > Hauptteil

Prepend and Append Files with?.htaccess

WBOY
Freigeben: 2016-06-06 20:09:18
Original
1201 Leute haben es durchsucht

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"
Nach dem Login kopieren

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

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!