Hi, I'm trying to integrate Assets Management into my application. I'm running into errors and can't seem to find any examples of how to use Assets Management within a layout.
What I have right now is this in my layout.phtml:
<!DOCTYPE html>
<html lang="en" data-ng-app="MyApp">
<head>
<title>MyApp</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!-- Foundation CSS -->
<link href="/lib/foundation/css/foundation.min.css" rel="stylesheet"/>
<!-- JQuery UI CSS -->
<link href="/lib/jquery-ui/jquery-ui.min.css" rel="stylesheet"/>
<style type="text/css">
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
</style>
<!-- LESS CSS -->
<link rel="stylesheet/less" type="text/css" href="/css/style.less" />
<script type="text/javascript" src="/lib/less/dist/less.min.js"></script>
<?php $this->assets->ouputJs(); ?>
...
and in my ControllerBase, I have this:
public function beforeExecuteRoute(Dispatcher $dispatcher)
{
$this->assets->addJs('/lib/foundation/js/vendor/modernizr.js')
->addJs('/lib/jquery/jquery.min.js')
->addJs('/lib/angular/angular.min.js')->join(true);
}
I'm getting errors of call to undefined method of outputJs() and join(). I'm guessing I'm missing a use or am I doing this completely wrong?