tags:

views:

49

answers:

1

I'm not very clear about HAML, but as far as I know it is a templating language, and PHP already has that functionality. Would it make sense to include PHP syntax inside a HAML file or it would be redundant(?):

#navigation
 %p
  <?php include("navigation.html"); ?>
+2  A: 

PHP is often used in conjunction with a templating language. Including html files in HAML would be strange, as HAML is supposed to generate HTML.

The combination is best used like this: PHP acts as the controller and the model, getting variables from the database and dispatching to the right page. HAML acts as the view, which takes the variables from PHP and makes anice HTML page from it.

See also: Model-view-controller

Sjoerd