class Controller_Example extends Controller
{
public function action_index()
{
$data['css'] = Asset::css(array('reset.css','960.css','main.css'));
return Response::forge(View::forge('welcome/index'));
}
}
does nothing with the $data array, and I can't find a solution in the relevant "Asset" docs.class Controller_Example extends Controller
{
public function action_index()
{
// create the view
$view = View::forge('welcome/index');
// assign the assets to the view variable 'css'. Use 'false' to prevent the HTML to be escaped
$view->set('css', Asset::css(array('reset.css','960.css','main.css')), false);
// return the view
return $view;
}
}
// in your view
<?php echo $css; ?>
// controller
class Controller_Example extends Controller
{
public function action_index()
{
// add the assets to the asset group 'header'
Asset::css(array('reset.css','960.css','main.css')), array(), 'header');
// return the view
return View::forge('welcome/index');
}
}
// in your view
<?php echo Asset::render('header'); ?>
It looks like you're new here. If you want to get involved, click one of these buttons!