UAP 4 Documentation - Assets

Welcome to UAP Docs - Assets

Assets Library


Assets Library handles all files that are loaded from the Assets and Template Assets folders.

How does the Assets Library handle files?
When a file is requested by a browser, the script checks to see if the file exist and is allowed file type. Once the file is good to go, the script then reads the file and writes it to the output buffer. Visit the php.net readfile documentation for more information.

The following file types may be used with the Assets Library:

*.jpg
*.jpeg
*.png
*.css
*.js

To load an image from your default template folder on any page just using the following code within your view files:

<img src='<?=SITE_URL?>/Templates/<?=DEFAULT_TEMPLATE?>/Assets/images/imagename.gif' class='img-responsive' />

To load an image from your root assets folder use the following code within your view files:

<img src='<?=SITE_URL?>assets/images/imagename.gif' class='img-responsive' />

To load a css file or files use the following code within Template or View files:

Single File
use Libs\Assets;

<?=Assets::css([
SITE_URL.'Templates/Default/Assets/css/style.css'
])?>

Multiple Files
use Libs\Assets;

<?=Assets::css([
SITE_URL.'Templates/Default/Assets/css/style.css',
SITE_URL.'Templates/Default/Assets/css/style2.css'
])?>

To load js file or files use the following code within Template or View files:

Single File
use Libs\Assets;
<?=Assets::css([
SITE_URL.'Templates/Default/Assets/js/script.js'
])?>

Multiple Files
use Libs\Assets;
<?=Assets::css([
SITE_URL.'Templates/Default/Assets/js/script.js',
SITE_URL.'Templates/Default/Assets/js/script2.js'
])?>

- Can't find what your looking for? Please use Forum.

UAP 4 Documentation - Assets

Title
Statistics
Last Reply
Forum Permissions
You cannot post in this forum.
You cannot moderate this forum.
You cannot administrate this forum.