You are here

class Kint_Objects_Smarty in Devel 8

Same name and namespace in other branches
  1. 8.2 kint/kint/parsers/objects/smarty.php \Kint_Objects_Smarty

Hierarchy

Expanded class hierarchy of Kint_Objects_Smarty

File

kint/kint/parsers/objects/smarty.php, line 3

View source
class Kint_Objects_Smarty extends KintObject {
  public function parse(&$variable) {
    if (!$variable instanceof Smarty || !defined('Smarty::SMARTY_VERSION')) {
      return false;
    }
    $this->name = 'object Smarty (v' . substr(Smarty::SMARTY_VERSION, 7) . ')';

    # trim 'Smarty-'
    $assigned = $globalAssigns = array();
    foreach ($variable->tpl_vars as $name => $var) {
      $assigned[$name] = $var->value;
    }
    foreach (Smarty::$global_tpl_vars as $name => $var) {
      if ($name === 'SCRIPT_NAME') {
        continue;
      }
      $globalAssigns[$name] = $var->value;
    }
    return array(
      'Assigned' => $assigned,
      'Assigned globally' => $globalAssigns,
      'Configuration' => array(
        'Compiled files stored in' => isset($variable->compile_dir) ? $variable->compile_dir : $variable
          ->getCompileDir(),
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
KintObject::$name public property @var string type of variable, can be set in inherited object or in static::parse() method
KintObject::$value public property @var string quick variable value displayed inline
Kint_Objects_Smarty::parse public function * returns false or associative array - each key represents a tab in default view, values may be anything * * Overrides KintObject::parse