FUEL CMS Forum
Discussions
Activity
Home
›
Development
›
Modules
Sign In
·
Register
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
3.3K
All Categories
255
FUEL CMS News
112
News & Announcements
101
Share
273
Support
115
Bug Reports
90
Installation
242
Development
68
Feature Requests
117
Modules
CRITICAL SECURITY VERSION UPDATE:
https://github.com/daylightstudio/FUEL-CMS/releases/tag/1.4.13
Call to undefined function fuel_nav() in global.php
Fabiosliva
April 2012
edited April 2012
in
Modules
I followed the same method of controllers as that of blog/settings but i am getting error as fuel_nav() undefined
Comments
admin
April 2012
edited 5:11PM
Could you provide a little more information or recreation steps to help debug?
Fabiosliva
April 2012
edited 5:11PM
This is my controller
<?php
require_once(FUEL_PATH.'/libraries/Fuel_base_controller.php');
class example1 extends Fuel_base_controller {
public $nav_selected = 'example1';
function __construct()
{
parent::__construct();
$this->config->module_load('example1', 'example1');
$this->_validate_user('example1');
}
function index()
{
$this->load->module_model(EXAMPLE_FOLDER, 'example');
$this->js_controller_params['method'] = 'add_edit';
$field_values = $this->example->find_all_array_assoc('number');
if (!empty($_POST['example1']))
{
// format data for saving
$save = array();
foreach($field_values as $field => $value)
{
$example1 = $this->input->post('example1', TRUE);
$val = (isset($example1[$field])) ? $example1[$field] : '';
$save[] = array('number' => $field, 'value' => trim($val));
}
$this->example->save($save);
$this->session->set_flashdata('success', lang('data_saved'));
redirect($this->uri->uri_string());
}
$this->load->library('form_builder');
$fields = array();
$fields['number'] = array();
$fields['date'] = array();
$fields['time'] = array();
$fields['invoiceno'] = array();
$fields['invoicedate'] = array();
$this->form_builder->label_layout = 'left';
$this->form_builder->form->validator = &$this->example->get_validation();
$this->form_builder->use_form_tag = FALSE;
$this->form_builder->set_fields($fields);
$this->form_builder->display_errors = FALSE;
$this->form_builder->name_array = 'example1';
$this->form_builder->submit_value = 'Save';
$this->form_builder->set_field_values($field_values);
$vars = array();
$vars['form'] = $this->form_builder->render();
a$vars['warn_using_config'] = !$this->config->item('blog_use_db_table_settings');
$this->_render('example1', $vars);
}
}
admin
April 2012
edited 5:11PM
What is the URI to this page and do you have a route in place for it? Is it at least getting to the constructor method?
Sign In
or
Register
to comment.
Forum Software Powered by Vanilla
Comments
<?php
require_once(FUEL_PATH.'/libraries/Fuel_base_controller.php');
class example1 extends Fuel_base_controller {
public $nav_selected = 'example1';
function __construct()
{
parent::__construct();
$this->config->module_load('example1', 'example1');
$this->_validate_user('example1');
}
function index()
{
$this->load->module_model(EXAMPLE_FOLDER, 'example');
$this->js_controller_params['method'] = 'add_edit';
$field_values = $this->example->find_all_array_assoc('number');
if (!empty($_POST['example1']))
{
// format data for saving
$save = array();
foreach($field_values as $field => $value)
{
$example1 = $this->input->post('example1', TRUE);
$val = (isset($example1[$field])) ? $example1[$field] : '';
$save[] = array('number' => $field, 'value' => trim($val));
}
$this->example->save($save);
$this->session->set_flashdata('success', lang('data_saved'));
redirect($this->uri->uri_string());
}
$this->load->library('form_builder');
$fields = array();
$fields['number'] = array();
$fields['date'] = array();
$fields['time'] = array();
$fields['invoiceno'] = array();
$fields['invoicedate'] = array();
$this->form_builder->label_layout = 'left';
$this->form_builder->form->validator = &$this->example->get_validation();
$this->form_builder->use_form_tag = FALSE;
$this->form_builder->set_fields($fields);
$this->form_builder->display_errors = FALSE;
$this->form_builder->name_array = 'example1';
$this->form_builder->submit_value = 'Save';
$this->form_builder->set_field_values($field_values);
$vars = array();
$vars['form'] = $this->form_builder->render();
a$vars['warn_using_config'] = !$this->config->item('blog_use_db_table_settings');
$this->_render('example1', $vars);
}
}