• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newb Questions

#1
[eluser]Unknown[/eluser]
Hello,

Experienced PHP programmer and a total newb at Code Igniter. A couple questions for you because I didn't find them anywhere else.

Is there anyway that a view can call another view? I want to be able to just call $this->load->view('contact', $data); rather than calling the header file, the contact file, and the footer file. I want to reuse the header and footer for all of my views without having to write two extra lines of code each time I call a view.

I'm a little confused with the best way to get a contact form working. How should I organize functions and views for the controller that handles a contact form? Right now I have a function called validateForm that validates the form and then sends an email, this is called (using the routing config) when I hit the page /contact/validate-form/. The issue is that if I print the contact view on this page with the php validation errors it is a different url and I want it to be the same URL (/contact/).

Thanks,


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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