I use XSLT as template engine in my PHP framework. I set some text to Renderer script, which converts it to xml and pass to XSLTProcessor:\[code\]<?phpclass IndexController extends ActionAbstract { public function doAuth() { $this->_Renderer->some_text = 'Translatable text'; }}?>\[/code\]View looks something like this:\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xslutput method="xml"/> <xsl:template match="/"> <html> <head><title>Index.xsl</title></head> <body> Here is some text to be translated <br/> <xsl:value-of select="root/some_text"/> </body> </html> </xsl:template></xsl:stylesheet>\[/code\]So, I have 2 types of text in views:
- Dynamic (setted from ActionController $this->_Renderer->some_text = 'Translatable text')
- Hardcoded in view (Here is some text to be translated)