Exemplo n.º 1
0
<head>
    <title>Assets sample</title>

    <?php 
// output header collection styles
echo Assets::container('header')->styles();
?>

    <?php 
// output header collection scripts
echo Assets::container('header')->scripts();
?>
</head>

<body>

    <h1>Assets test</h1>

    <p>View the source to see your asset code generated.</p>

    <?php 
// Add a new Asset to the footer collection after it's initial creation
Assets::container('footer')->add(new Dmlogic\Assets\Script(['inline' => 'console.log("An inline script");']));
?>

    <?php 
// output footer collection scripts
echo Assets::container('footer')->scripts();
?>
</body>
</html>
Exemplo n.º 2
0
 private function newSampleContainer($name = null)
 {
     $container = Assets::container($name);
     $container->add([new Dmlogic\Assets\Script(['path' => 'file.js']), new Dmlogic\Assets\Style(['href' => 'file.css'])]);
     return $container;
 }