title: How do I use a template engine in Yii?
body: <p>I want to write a program with Yii so that users can have their template.</p>
  
  <p>My solution is that every user has a record in a DB to keep a customized template like HTML code and some syntax like Smarty or Twig.</p>
  
  <p>How can I use PHP to get that records and just print it on the screen and my template engine extracts syntax and shows best results? Is that possible or not? How should I do this?</p>
  
  <p>Really you know if you save php codes in database, when you print them into a file, php codes you saved in database don't run. 
  For me the most important thing is that to save template in database whit php commands and then echo them in a file and php code run same usually. </p>
  
  <p>But is is important to use smarty or twig and don't let users add php codes directly. </p>