Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to isolate the style (css+html) from php

how can i isolate the style (css+html) from php, like put in the php file just some lines including by it the whole style or theme.

ex:

echo 
    eval_template("header") .
    eval_template("body") .
    eval_template("footer")

So in future i can change the whole style without touch the php files any idea ?

like image 878
Imad Avatar asked Jul 11 '26 15:07

Imad


1 Answers

there are many ways how you could do this...

Here's a tutorial on templating in plain PHP http://www.phpro.org/tutorials/Introduction-to-PHP-templating.html

You can also take a look at the many template engines out there. twig is one of them: http://twig.sensiolabs.org/

like image 100
mgherkins Avatar answered Jul 14 '26 05:07

mgherkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!