Even though PyroCMS is an excellent CMS to use and I highly recommend anybody and everybody using when the situation grants it.
However, my situation calls for a custom CMS that just has quite a bit of differences that I am instead developing mine with the use of some of the libraries I see out there that are free to use. The main one I am currently working with right now is Phil Sturgeon’s Template library.
Now since obviously he uses it for PyroCMS I am trying to match up as close to a file structure as he does with that so that the template system will flow smoothly without any issues.
I am currently in a quandary right now because I have my login form is not finding a partial and I’m not quite sure why. When my dashboard calls the metadata partial it loads it up just fine but something is amidst and is not loading it when I call it in the login form.
Here is my current login controller, login form view, and the file structure to ensure it is set up properly.
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends Backend_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->template
->set_layout(FALSE)
->build('login');
}
}
<head>
<!-- metadata needs to load before some stuff -->
<?php file_partial('metadata'); ?>
</head>
applications/
themes/
supr(my custom theme from template)/
views/
login.php
partials/
metadata.php
Any ideas from anyone?
In your controller:
$this->template
->set_layout(FALSE)
->set_partial('metadata', 'partials/metadata.php')
->build('login');
}
note the added call to set_partial.
In your view:
<?php echo $template['partials']['metadata']; ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With