*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
- * $Id$
- *
*/
/**
}
}
- $smartyDir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR;
+ $pkgsDir = Civi::paths()->getVariable('civicrm.packages', 'path');
+ $smartyDir = $pkgsDir . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR;
$pluginsDir = __DIR__ . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR;
if ($customPluginsDir) {
/**
* Temporarily assign a list of variables.
*
- * @code
+ * ```
* $smarty->pushScope(array(
* 'first_name' => 'Alice',
* 'last_name' => 'roberts',
* ));
* $html = $smarty->fetch('view-contact.tpl');
* $smarty->popScope();
- * @endcode
+ * ```
*
* @param array $vars
* (string $name => mixed $value).
$oldVars = $this->get_template_vars();
$backupFrame = [];
foreach ($vars as $key => $value) {
- $backupFrame[$key] = isset($oldVars[$key]) ? $oldVars[$key] : NULL;
+ $backupFrame[$key] = $oldVars[$key] ?? NULL;
}
$this->backupFrames[] = $backupFrame;