Welcome Guest, Not a member yet? Register   Sign In
Create .html pages
#1

[eluser]Unknown[/eluser]
Hi there,

I've been looking on the internet for help with this. Too bad i couldnt find anything helpfull.

I've got a page controller and i'm using the template builder.
Now with my page controller

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Page extends CI_Controller
{
    
    public $layout  = 'default';
    public $templateName;
    
    public function __construct()
    {
parent::__construct();
$this->template->set_layout($this->layout);
    }
    
    /**
     * Index page
     */
    public function index($page = 'default')
    {
$this->templateName = $page;
$this->template->title('Websitea');
$this->template->build($this->templateName);
    }        
}

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

And my routes.php

Code:
$route['page/(:any)']   = 'page/$1';
So in my view dir i've got a 'default.php' template, that will be the homepage, now i want to make more pages, like about-me, i got the file 'about-me.php' also in my view dir.

What i want now, is that i can visit localhost://[websitename]/about-me.html and that would the load the about-me.php template.
Because now its like localhost/[websitename]/page/about-me

Could someone help me with this problem?


Messages In This Thread
Create .html pages - by El Forum - 02-15-2014, 03:34 PM
Create .html pages - by El Forum - 02-15-2014, 04:15 PM
Create .html pages - by El Forum - 02-15-2014, 04:27 PM
Create .html pages - by El Forum - 02-16-2014, 06:01 AM
Create .html pages - by El Forum - 02-16-2014, 08:03 AM
Create .html pages - by El Forum - 02-18-2014, 04:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB