And happy 2016 ;-)
I'm actually trying to learn ZF2, and I have some problems that I dont' know how to resolve.
First, you have to know that the project is running under vagrant. I have 2 modules:
- Admin
- Application
I have a layout for each module.
In the admin layout module, I have some style and JS file: All this JS and CSS files are in the public folder.
<?= $this
->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico'))
->prependStylesheet($this->basePath('bower_components/bootstrap/dist/css/bootstrap.min.css'))
->prependStylesheet($this->basePath('bower_components/font-awesome/css/font-awesome.min.css'))
->prependStylesheet($this->basePath('bower_components/Ionicons/css/ionicons.min.css'))
->prependStylesheet($this->basePath('css/AdminLTE.min.css'))
->prependStylesheet($this->basePath('css/skins/skin-blue.min.css'))
; ?>
<?=
$this->inlineScript()
->prependFile($this->basePath('bower_components/jquery/dist/jquery.min.js'))
->prependFile($this->basePath('bower_components/bootstrap/dist/js/bootstrap.min.js'))
->prependFile($this->basePath('js/app.min.js'))
;?>
For some CSS file, I have errors in the browser:
Resource interpreted as Stylesheet but transferred with MIME type text/html
And for JS, I have problems too:
Bootstrap's JavaScript requires jQuery
I know this JS error, it append when you load boostrap.js before jquery.js. But here, it's not the case!
I don't know if the problem comes from my layout integration of CSS and JS files, or if I forgot something in the controller, or in the configuration. May be it's a problem with vagrant too?
I also have a htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
Please, I need some help because i'm lost ;-)
Thanks for any advice/documentation or else.