Misago\ActionView\Helpers\AssetTag

Renders HTML tags to include assets like images, stylesheets and javascript files in your pages.

Timestamps

The last modification date is always added to all local and existing assets. This permits for browser-side HTTP caching. The actual HTTP caching must be handled by your web server (ie. the 'compress' module of LightTPD).

Functions:

image_path($src)

Linearizes an image path.

image_path('logo.jpg');          # /img/logo.jpg
image_path('/path/to/logo.jpg'); # /path/to/logo.jpg
image_path('http://mybrand.com/path/to/logo.jpg'); # http://mybrand.com/path/to/logo.jpg 

javascript_path($src)

Linearizes a javascript path.

javascript_path('logo.js');          # /js/logo.js
javascript_path('/path/to/logo.js'); # /path/to/logo.js
javascript_path('http://mybrand.com/logo.js'); # http://mybrand.com/logo.js 

stylesheet_path($href)

Linearizes a stylesheet path.

stylesheet_path('logo.css');          # /js/logo.css
stylesheet_path('/path/to/logo.css'); # /path/to/logo.css
stylesheet_path('http://mybrand.com/css/logo.css'); # http://mybrand.com/css/logo.css 

image_tag($src, $attributes=null)

Renders an IMG tag.

image_tag('logo.jpg');
image_tag('logo.jpg', array('alt' => 'my logo',
  'title' => "Ain't my logo pretty?", 'class' => 'brand')); 

javascript_include_tag($args)

Includes one or more javascript files.

javascript_include_tag('app.js');
javascript_include_tag('framework.js', 'app.js');