list[$prefix] = $path; } /** * */ public function addVar($name, $value) { $this->variables['$' . $name] = $value; } /** * Возвращает путь по имени ярлыка */ static function getUrl($prefix, $name = null, $name1 = null) { $shortcut = self::getInstance(); $names = $shortcut->variables; if ($name) { $names['$name'] = $name; } if ($name1) { $names['$name1'] = $name1; } if (isset($shortcut->list[$prefix])) { return strtr($shortcut->list[$prefix], $names); } return null; } static function expand($path) { $shortcut = self::getInstance(); $names = $shortcut->variables; return strtr($path, $names); } }