X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/platform/packages/theme/src
home
/
gfecatvj
/
sites
/
realesbar
/
platform
/
packages
/
theme
/
src
/
📁
..
📄
Asset.php
(2.63 KB)
📄
AssetContainer.php
(17.31 KB)
📄
Breadcrumb.php
(1.45 KB)
📁
Commands
📁
Contracts
📁
Events
📁
Exceptions
📁
Facades
📁
Forms
📁
Http
📄
Manager.php
(1.05 KB)
📁
Providers
📁
Services
📁
Supports
📄
Theme.php
(25.69 KB)
📄
ThemeOption.php
(15.21 KB)
Editing: Asset.php
<?php namespace Botble\Theme; use Closure; class Asset { /** * Path to assets. * * @var string */ public static $path; /** * All of the instantiated asset containers. * * @var array */ public static $containers = []; /** * Asset buffering. * * @var array */ protected $stacks = [ 'cooks' => [], 'serves' => [], ]; /** * Add a path to theme. * * @param string $path */ public function addPath($path) { static::$path = rtrim($path, '/') . '/'; } /** * Cooking your assets. * * @param string $name * @param Closure $callbacks * @return void */ public function cook($name, Closure $callbacks) { $this->stacks['cooks'][$name] = $callbacks; } /** * Serve asset preparing from cook. * * @param string $name * @return Asset */ public function serve($name) { $this->stacks['serves'][$name] = true; return $this; } /** * Flush all cooks. * * @return void */ public function flush() { foreach (array_keys($this->stacks['serves']) as $key) { if (array_key_exists($key, $this->stacks['cooks'])) { $callback = $this->stacks['cooks'][$key]; if ($callback instanceof Closure) { $callback($this); } } } } /** * Magic Method for calling methods on the default container. * * <code> * // Call the "styles" method on the default container * echo Asset::styles(); * * // Call the "add" method on the default container * Asset::add('jquery', 'js/jquery.js'); * </code> * @param $method * @param $parameters * @return mixed */ public function __call($method, $parameters) { return call_user_func_array([static::container(), $method], $parameters); } /** * Get an asset container instance. * * <code> * // Get the default asset container * $container = Asset::container(); * * // Get a named asset container * $container = Asset::container('footer'); * </code> * * @param string $container * @return AssetContainer */ public static function container($container = 'default') { if (!isset(static::$containers[$container])) { static::$containers[$container] = new AssetContainer($container); } return static::$containers[$container]; } }
Upload File
Create Folder