title: Passing variable to smarty function
body: <p>In my PHP application, I am using Smarty for templating and use some custom functions. In the below example the function name is "text" which takes the "key" attribute. This function will get the string value based on the key</p>
  
  <p>The below example works fine without issues.</p>
  
  <pre><code>{text key='isearch+login_name'}
  </code></pre>
  
  <p>What I am trying to do is to pass a value dynamically to the attribute. In the below code the variable $plugin will have the dynmaci value and want to be substituted.</p>
  
  <pre><code>{text key='isearch+$plugin_plugin'}
  </code></pre>
  
  <p>With the above code, I get the output as 'isearch+$plugin_plugin' and not the correct string value.</p>
  
  <p>PHP function for the Smarty function is below.</p>
  
  <pre><code>function smarty_function_text($params, $smarty)
  {
      $key = $params['key'];
      unset($params['key']);
  
      $key = explode('+', $key);
  
      return OW::getLanguage()-&gt;text($key[0], $key[1], $params);
  }
  </code></pre>