Common\Core\Twig\BaseTwigTemplate::assignArray PHP Метод

assignArray() публичный Метод

Assign an entire array with keys & values.
public assignArray ( array $variables, $index = null )
$variables array This array with keys and values will be used to search and replace in the template file.
    public function assignArray(array $variables, $index = null)
    {
        // artifacts?
        if (!empty($index) && isset($variables['Core'])) {
            unset($variables['Core']);
            $tmp[$index] = $variables;
            $variables = $tmp;
        }
        // merge the variables array_merge might be to slow for bigger sites
        // as array_merge tend to slow down at +100 keys
        foreach ($variables as $key => $val) {
            $this->variables[$key] = $val;
        }
    }