Tuesday, 15 February 2011

preprocessor - Pre-processor alternative to PHP's include()? -



preprocessor - Pre-processor alternative to PHP's include()? -

on personal website have lots of items re-used quite lot. illustration might have 2 different landing pages different layout, same content. example:

landing-1.php:

include( 'header.php' ); include( 'about-us.php' ); include( 'contact-us.php' );

landing-2.php:

include( 'header.php' ); include( 'portfolio.php' ); include( 'contact-us.php' );

now looking alternative can create static html pages instead of having utilize php inclusions. ideally script grab content of included files , paste @ right place. wouldn't php.

(i hope question suited so, or there se site should use?)

if you're looking dynamically, , using apache, might want @ server side includes. they're much lighter weight total php script. iis has similar module, nginx.

if, instead, want generate html 1 time , store it, can utilize pre-existing php pages. utilize php on command line, passing page interpreter. if you've not used http specific php functionality in pages (i.e. $_cookies etc), spit out finished html store , serve other static content.

php preprocessor

No comments:

Post a Comment