• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[RESOLVED] Issue with validation + coolfactor's View library (I'm a retard)

#1
[eluser]awpti[/eluser]
So, I'm using coolfactor's View library for ignitedjobs.com

Whenever I 'run' the validation, any 'part' I set doesn't get defined in the view, ex (in the controller):

$this->view->part('header', 'tpl/header');
$this->view->part('footer', 'tpl/footer');

And based upon the true/false of $this->validation->run(), I load the body ( $this->view->load('job_accepted'); )

This, for a reason I can not fathom, results in $header and $footer being undefined in the view.

You can see it here:

http://ignitedjobs.com/addjob/

Just hit submit (there's no code to handle the results other than the validation run - it's not creating entries).

Code is the same as any other page method.

Should I ditch CF's view library? I didn't see any way to handle 'parts' with CI's view lib.

#2
[eluser]awpti[/eluser]
Other info:

Here's the 'index':

Code:
function index()
{
  // This only renders the form.
  $this->view->part('header', 'tpl/header');
  $this->view->part('footer', 'tpl/footer');
  $this->view->load('add_job');
}

And the validation:

Code:
function validate()
{
    $this->view->part('header', 'tpl/header');
    $this->view->part('footer', 'tpl/footer');
    // Set the validation rules.
    $rules = array
    (
           'location'              => '',
           'email'                 => 'required|valid_email',
           'job_title'             => '',
           'description'           => '',
           'to_apply'              => ''
    );

    $this->validation->set_rules($rules);
    if ($this->validation->run() == FALSE)
    {
           $this->load->view('add_job');
    }
    else
    {
           $this->load->view('job_accepted');
    }
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.