Maison > php教程 > php手册 > le corps du texte

Prepend and Append Files with?.htaccess

WBOY
Libérer: 2016-06-06 20:09:18
original
1201 Les gens l'ont consulté

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"
Copier après la connexion

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

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Recommandations populaires
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!