zoukankan      html  css  js  c++  java
  • HelpersAssets

    HelpersAssets

    The assets helper is for loading CSS and JS files rather than writing out the full script/link tag for each and every item, instead add them to an array pass to the assets and it output the link/script tags for you.

    Usage example for loading CSS files:

    Assets::css([
        'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css',
        Url::templatePath().'css/style.css',
    ]);

    Will output:

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="http://novaframework.dev:8888/templates/default/assets/css/style.css" rel="stylesheet" type="text/css">

    Assets has 2 methods css and js, they can take a single value or an array of values.

    Example of loading a single js file:

    Assets::js(Url::templatePath().'css/app.js');

    Both methods have additional parameters other than the file/s:

    $cache Default set to false, when set to true the contents will be compressed and compiled into a single files placed within your theme css/js folder.

    $refresh Default set to false, set to true to update the cache.

    $cachedMins Time in seconds to hold the cache.

    Example using a cache:

    Assets::css([
        'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css',
        Url::templatePath().'css/style.css',
    ], true);

    Example using a cache and refresh:

    Assets::css([
        'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css',
        Url::templatePath().'css/style.css',
    ], true, true);
  • 相关阅读:
    Mina入门:mina版之HelloWorld
    Mina入门:Java NIO基础概念
    Activity与Service进行数据交互
    Android 6.0权限全面详细分析和解决方案
    查看Android系统是User模式还是Eng模式
    修改 Android 5.x 系统默认音量大小
    Android执行程序或脚本的方法
    Android Launcher 3 简单分析
    将Android系统源码导入ecplise
    Scrum三大角色特点
  • 原文地址:https://www.cnblogs.com/chunguang/p/5643104.html
Copyright © 2011-2022 走看看