Prepend and Append Files with?.htaccess
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 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
上一篇: CentOS7配置epel镜像并安装更新
下一篇: Python基础学习代码之条件和循环
推荐阅读
-
jQuery添加新内容的四个常用方法分析【append,prepend,after,before】
-
PHP中auto_prepend_file与auto_append_file用法实例分析
-
jQuery 追加元素的方法如append、prepend、before
-
jQuery中append(),prepend()与after(),before()的区别
-
PHP中auto_prepend_file与auto_append_file用法实例分析,autoprependfile
-
Prepend and Append Files with?.htaccess
-
PHP中auto_prepend_file与auto_append_file用法实例分析
-
jQuery 追加元素的方法如append、prepend、before_jquery
-
PHP中auto_prepend_file与auto_append_file用法实例分析_PHP
-
jQuery 追加元素的方法如append、prepend、before_jquery