How to reference Smarty variables inside {php} tags

I gotta’ be honest, I’ve never used the Smarty¬†Template¬†Engine before in my life. I’m currently working on a project to integrate WordPress and JobberBase so they use the same WordPress theme. JobberBase uses Smarty, so I’m getting a crash course.

You can use PHP in the template (.tpl) files and reference the values of the assigned Smarty template variables like this:

  $html_title = $this->_tpl_vars['html_title'];
  $echo $html_title;

I’m sure Smarty users cringe at this sort of thing, being that it adds business logic to the template files. But, this is just the functionality I need to hack the JobberBase templates without mucking around in core JobberBase code.

I found this solution in the Smarty FAQ after hours of Googling.