Welcome Guest, Not a member yet? Register   Sign In
CSS is being generated?
#12

[eluser]spletta[/eluser]
Like this...

I'm doing some templating which looks like this in my file system: views/includes/footer.php & header.php & template.php
When a View has a controller named contact.php then under the /views folder I made a contact/ folder and named the view index.php

contact/index.php
Code:
<div id="contact_form">
  <h1>Contact Us, Fool!</h1>
  &lt;?php
  echo form_open('contact/submit');
  echo form_input('name', 'Name', 'id="name"');
  echo form_input('email', 'Email', 'id="email"');
  $data = array('name' => 'messages', 'cols' => 35, 'rows' => 12);
  echo form_textarea($data, 'Message', 'id="message"');
  echo form_submit('submit', 'Submit', 'id="submit"');
  echo form_close();
  ?&gt;
</div>

controllers/contact.php
Code:
&lt;?php

class Contact extends Controller
{
  
  function index()
  {
    $data['main_content'] = 'contact/index';
    $this->load->view('includes/template', $data);
  }
  
  function submit()
  {
    $name = $this->input->post('name');
    // email.. store in db etc.
    // then ...
    
    $data['main_content'] = 'contact/contact_submitted';
    
    if ($this->input->post('ajax'))
    {
      $this->laod->view($data['main_content']);
    }
    else
    {
      $this->load->view('includes/template', $data);
    }
  }
}

The only thing I'm doing different from the tutorials I'm following is organizing my views into folders with the same name as the controller.. I'm not sure if that causes this.. well I just tested that actually and it still acts the same.

Could it be that I'm naming the views index.php? They seem to work otherwise? Nope I just tested that too... Confusedmirk:


Messages In This Thread
CSS is being generated? - by El Forum - 07-08-2010, 07:07 AM
CSS is being generated? - by El Forum - 07-08-2010, 07:10 AM
CSS is being generated? - by El Forum - 07-08-2010, 07:17 AM
CSS is being generated? - by El Forum - 07-08-2010, 08:06 AM
CSS is being generated? - by El Forum - 07-08-2010, 08:23 AM
CSS is being generated? - by El Forum - 07-08-2010, 09:20 AM
CSS is being generated? - by El Forum - 07-08-2010, 09:59 AM
CSS is being generated? - by El Forum - 07-08-2010, 11:00 AM
CSS is being generated? - by El Forum - 07-08-2010, 12:04 PM
CSS is being generated? - by El Forum - 07-09-2010, 05:36 AM
CSS is being generated? - by El Forum - 07-09-2010, 06:39 AM
CSS is being generated? - by El Forum - 07-09-2010, 07:44 AM
CSS is being generated? - by El Forum - 07-09-2010, 07:52 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:09 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:19 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:21 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:23 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:41 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:47 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:56 AM
CSS is being generated? - by El Forum - 07-09-2010, 08:59 AM
CSS is being generated? - by El Forum - 07-09-2010, 09:17 AM
CSS is being generated? - by El Forum - 07-09-2010, 09:28 AM
CSS is being generated? - by El Forum - 07-09-2010, 09:44 AM
CSS is being generated? - by El Forum - 07-10-2010, 08:46 AM
CSS is being generated? - by El Forum - 07-10-2010, 08:54 AM
CSS is being generated? - by El Forum - 07-10-2010, 08:56 AM
CSS is being generated? - by El Forum - 07-10-2010, 08:58 AM
CSS is being generated? - by El Forum - 07-10-2010, 09:00 AM
CSS is being generated? - by El Forum - 07-10-2010, 09:02 AM
CSS is being generated? - by El Forum - 07-10-2010, 09:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB