$locator = $app->getLocator();
$view = $locator->get('view');
- $url = $view->plugin('url');
- $url->setRouter($app->getRouter());
- $view->plugin('doctype')->setDoctype('HTML5');
-
- $view->plugin('headTitle')->setSeparator(' - ')
- ->setAutoEscape(false)
- ->append('ZF2 Skeleton Application');
+ // Set up view helpers
+ $view->plugin('url')->setRouter($app->getRouter());
+ $view->doctype()->setDoctype('HTML5');
$basePath = $app->getRequest()->getBaseUrl();
-
- $view->plugin('headLink')->appendStylesheet($basePath . '/css/bootstrap.min.css');
-
- $html5js = '<script src="' . $basePath . '/js/html5.js"></script>';
- $view->plugin('placeHolder')->__invoke('html5js')->set($html5js);
- $favicon = '<link rel="shortcut icon" href="' . $basePath . '/images/favicon.ico">';
- $view->plugin('placeHolder')->__invoke('favicon')->set($favicon);
+ $view->plugin('basePath')->setBasePath($basePath);
$this->view = $view;
return $view;
-<?php echo $this->doctype() ?>
+<?php
+$this->headTitle()->setSeparator(' - ')
+ ->setAutoEscape(false);
+
+$basePath = $this->basePath();
+$this->headLink()->appendStylesheet($basePath . '/css/bootstrap.min.css');
+
+$this->headLink(array(
+ 'rel' => 'shortcut icon',
+ 'type' => 'image/vnd.microsoft.icon',
+ 'href' => $basePath . '/images/favicon.ico',
+ ));
+
+// HTML5 shim, for IE6-8 support of HTML elements
+$this->headScript()->appendFile($basePath . '/js/html5.js', 'text/javascript',
+ array('conditional' => 'lt IE9',));
+
+echo $this->doctype();
+?>
<html lang="en">
<head>
<meta charset="utf-8">
- <?php echo $this->headTitle() ?>
+ <?php echo $this->headTitle('ZF2 Skeleton Application') ?>
<?php echo $this->headMeta() ?>
}
</style>
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
- <!--[if lt IE 9]>
- <?php echo $this->placeholder('html5js') ?>
- <![endif]-->
-
+ <!-- Scripts -->
<?php echo $this->headScript() ?>
- <!-- Le fav and touch icons -->
- <?php echo $this->placeholder('favicon') ?>
-
</head>
<body>