Hi guys,
I have an issue when loading a partial template. My styling and JavaScript files all give a 404 not found error.
My css files all live in the inc/styles.phtml file.
This only happens on a specific controller called "Section". When I access my /section/a page there is no styling. The section controller source :
<?php
namespace My\Controllers;
use \Phalcon\Mvc\Controller;
class SectionController extends \Phalcon\Mvc\Controller {
public function indexAction()
{
// redirect any index responses back to 404 controller
}
public function showAction()
{
$section = $this->dispatcher->getParam("section");
$this->view->setVar("section", $section);
//Load the correct view
$this->view->pick('section/' . $section);
}
The inc/styles.phtml file :
<!-- General Style Sheets -->
<link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
I have notice the path to the resources is completely wrong. The /section name is added in the url.
Here is the views/section/a.phtml file source :
<!doctype html>
<html
<head>
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- could this be the problem?? -->
<?php
$this->partial("inc/styles")
?>
</head>
<body>
<h1> Hello Section : <?php echo $section; ?> </h1>
</body>
</html>