Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Assets
  • ComposerUtility
  • Events
  • FilterInput
  • FixedGroups
  • HttpRequest
  • Logger
  • MediaUploader
  • MimeTypes
  • PreloadItem
  • Psr0ClassLoader
  • Psr4ClassLoader
  • Random
  • Registry
  • Request
  • Security
  • XoopsTpl
  • Yaml

Interfaces

  • AttributeInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class Assets

Provides a standardized asset strategy

Namespace: Xoops\Core
Package: Assets
Category: Assets
Copyright: 2014-2015 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Version: Release: 1.0
Since: 2.6.0
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Assets.php
Methods summary
public
# __construct( )

__construct

__construct

protected array
# readAssetsPrefs( )

readAssetsPrefs - read configured asset preferences

readAssetsPrefs - read configured asset preferences

Returns

array
of assets preferences
protected
# saveAssetsPrefs( array $assets_prefs )

saveAssetsPrefs - record array of assets preferences in config file, and update cache

saveAssetsPrefs - record array of assets preferences in config file, and update cache

Parameters

$assets_prefs
array of asset preferences to save
public string
# getUrlToAssets( string $type, array $assets, string|array $filters = 'default', string $target = null )

getUrlToAssets

getUrlToAssets

Create an asset file from a list of assets

Parameters

$type
type of asset, css or js
$assets
list of source files to process
$filters

either a comma separated list of known namsed filters or an array of named filters and/or filter object

$target
target path, will default to assets directory

Returns

string
URL to asset file
public true
# setDebug( )

setDebug enable debug mode, will skip filters prefixed with '?'

setDebug enable debug mode, will skip filters prefixed with '?'

Returns

true
public boolean
# registerAssetReference( string $name, mixed $assets, string|array $filters = null )

Add an asset reference to the asset manager

Add an asset reference to the asset manager

Parameters

$name
the name of the reference to be added
$assets

a string asset path, or an array of asset paths, may include wildcard

$filters

either a comma separated list of known named filters or an array of named filters and/or filter object

Returns

boolean
true if asset registers, false on error
public mixed
# copyFileAssets( string $from_path, string $pattern, string $output )

copyFileAssets - copy files to the appropriate asset directory.

copyFileAssets - copy files to the appropriate asset directory.

Copying is normally only needed for fonts or images when they are referenced by a relative url in stylesheet, or are located outside of the web root.

Parameters

$from_path
path to files to copy
$pattern
glob pattern to match files to be copied
$output
output type (css, fonts, images, js)

Returns

mixed

boolean false if target directory is not writable, otherwise integer count of files copied

API documentation generated by ApiGen