/** * @param $namespace * @return $this */ private function _set_namespace($namespace) { $this->_namespaces_list = isset($this->_namespaces_list) ? $this->_namespaces_list : []; if (empty($namespace)) { $namespace = self::$namespace = 'app'; } if (array_key_exists($namespace, $this->_namespaces_list)) { self::$scripts = $this->_namespaces_list[$namespace][self::SCRIPTS]; self::$styles = $this->_namespaces_list[$namespace][self::STYLES]; } else { $this->_namespaces_list[$namespace] = [self::STYLES => [], self::SCRIPTS => []]; self::$priority[$namespace] = [self::STYLES => 0, self::SCRIPTS => 0]; self::$scripts = []; self::$styles = []; } return $this; }
<?php echo Assets::styles('global'); ?> <?php echo Assets::scripts('global');