fix bug when there is a singlequote in template will generate bad php code