Welcome Guest, Not a member yet? Register   Sign In
Auto-load webpage structure
#5

[eluser]Ci beginner[/eluser]
[quote author="InsiteFX" date="1248683356"]Hi,

You need to create different views for the html web page.

header_view.php
content_view.php
footer_view.php

these shoud be in your CodeIgniter application views folder.

then in your html web page add tese views to it.

And this is how you pass data to your view.
Code:
<?php
/**
* Home Class
*
* @package        Package Name
* @subpackage    Subpackage
* @category    Category
* @author        Author Name
* @link        http://example.com
*/

class Home extends Controller {
    
    function __construct()
    {
        parent::Controller();
    }
    

    function index()
    {
        $data['mytitle']    = "Pro Covers FX CMS";
        $data['mytext']        = "This website helps you to keep track of the other websites you control.";
        $data['myrobots']    = 'name="robots" content="noindex, nofollow"';
        
        $data['mywebtitle']    = 'Web testing';
        $data['base']        = $this->config->item('base_url');
        $data['css']        = $this->config->item('css');
        
        $data['copyright']    = $this->config->item('copyright');
        $data['year']        = date("Y");
        $data['copyend']    = $this->config->item('copyend');

        $this->load->view('home', $data);
        
    }

}

/* End of file home.php */
/* Location: ../application/controllers/home.php */

html you will add these were they belong

Code:
<?php $this->load->view('header_view'); ?>
<?php $this->load->view('content_view'); ?>
<?php $this->load->view('footer_view'); ?>

Hope this helps.

Enjoy
InsiteFX
[/quote]

I didn't fully understand but I'll try it, thank you very much! Smile


Messages In This Thread
Auto-load webpage structure - by El Forum - 07-26-2009, 05:38 PM
Auto-load webpage structure - by El Forum - 07-26-2009, 07:06 PM
Auto-load webpage structure - by El Forum - 07-26-2009, 09:27 PM
Auto-load webpage structure - by El Forum - 07-26-2009, 09:29 PM
Auto-load webpage structure - by El Forum - 07-26-2009, 09:53 PM
Auto-load webpage structure - by El Forum - 07-27-2009, 05:35 AM
Auto-load webpage structure - by El Forum - 07-27-2009, 08:55 AM
Auto-load webpage structure - by El Forum - 07-28-2009, 07:59 AM
Auto-load webpage structure - by El Forum - 07-28-2009, 11:30 PM
Auto-load webpage structure - by El Forum - 07-29-2009, 09:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB