Render not working. Am I missing something?
I have the following controller. AM I missing something?
require_once(FUEL_PATH.'/libraries/Fuel_base_controller.php');
class Appointments extends Fuel_base_controller {
function __construct()
{
parent::__construct(FALSE);
}
function index()
{
$vars['body'] = $this->load->module_view(APPOINTMENT_BOOKER_FOLDER, 'themes/default/contact_us', $vars, TRUE);
$vars['layout'] = 'main';
$this->fuel->pages->render('appointments/create',$vars);
}
}
Comments
i created the view in
/fuel/modules/appointment_booker/views/themes/default/contact_us.php
to load that, i used
$vars['body'] = $this->load->module_view(APPOINTMENT_BOOKER_FOLDER, 'themes/default/contact_us', $vars, TRUE);
is it because i'm incorrectly rendering?
$this->fuel->pages->render('appointments/create',$vars);
i tried:
render('appointment_booker/appointments/create',$vars);
render('appointments/create',$vars);
still no luck. any thoughts?
$this->fuel->pages->render('appointments/create',$vars, array('view_module' => APPOINTMENT_BOOKER_FOLDER));
It will then look for a view file of 'appointments/create' in the APPOINTMENT_BOOKER_FOLDER instead of the application folder.
this seems related to another problem i had when i try to load a module model. for some reason, it will only pick up models in the application folder (non-module folder).
i will do a fresh install and see if it fixes it but please let me know if there is some sort of configuration i'm not aware of that may be causing it.
$this->fuel->pages->render('appointments/create',$vars, array('view_module' => APPOINTMENT_BOOKER_FOLDER, 'render_mode' => 'view'));
And just to be sure, you have a view file located at fuel/modules/{APPOINTMENT_BOOKER_FOLDER}/views/appointments/create?
For the models, you need to specify the model_location parameter for your module in your MY_fuel_modules.php file:
.... 'model_location' => APPOINTMENT_BOOKER_FOLDER, ...