示例#1
0
 /**
  * page method
  * @param string $current
  * */
 public function page($current = 'index')
 {
     $file = ROOT . 'assets/js/site/' . $current . '.js';
     if (file_exists($file)) {
         Asset::add('js', 'site/' . $current);
     }
     $this->withVars(array('page' => 'pages/' . $current))->renderView('layouts/content');
 }
示例#2
0
<?php

$styleFiles = \System\Core\Asset::getAssets('css');
for ($i = 0; $i < sizeof($styleFiles); $i++) {
    ?>
        <?php 
    $styleFile = $styleFiles[$i];
    ?>
    <link rel="stylesheet" href="<?php 
    echo TEMPLATE . $styleFile;
    ?>
">
<?php 
}
示例#3
0
<?php

$scriptFiles = \System\Core\Asset::getAssets('js');
for ($i = 0; $i < sizeof($scriptFiles); $i++) {
    ?>
    <?php 
    $scriptFile = $scriptFiles[$i];
    ?>
    <script language="JavaScript" type="text/javascript" src="<?php 
    echo TEMPLATE . $scriptFile;
    ?>
"></script>
<?php 
}