Welcome Guest, Not a member yet? Register   Sign In
How to use tempates
#1

[eluser]Suven[/eluser]
Hi!

I'm new to codeIgniter and wonder how you handle with templates.

My design is divided into 3 parts (header, footer and dynamic content).

In the past, when not using frameworks, I made a function like getTemplate('start/welcome') which then included my header, then the welcome.php and then the footer.

How is default approach on this in the CodeIgniter-Community?

Do you write library's which do something similar, do you use whole template-engines or do you just load view after view in the controller?

Are there any problems which might occur with catching or so when going a specific direction?

Thanks for your answers (:
#2

[eluser]BrokenLegGuy[/eluser]
I'm currently using this method of displaying multiple views.

http://codeigniter.com/wiki/Displaying_Multiple_Views/

I don't know if this is the standard method of creating/using templates but it's what I'm doing.

Ed
#3

[eluser]Genuine Scope[/eluser]
You can use views.
Code:
$data['email'] = $email;
        $this->load->view('viewName', $data);
If not you can use templates also.
Code:
class Customers extends Controller {
    function Customers() {
        $this->load->library('parser');
    }
    function index(){
      $data = array(
                'fname' => 'Genuine',
                'lname' => 'Scope'

        );
        $message = $this->parser->parse('email_template', $data);
    }

}
email_template.php
Code:
{fname}  {lname},
This is the template
#4

[eluser]InsiteFX[/eluser]
There are lots of template libraries in the ignited forums.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB