Welcome Guest, Not a member yet? Register   Sign In
how to create a new page
#1

[eluser]macleodjb[/eluser]
I created a controller called register with the following code

Code:
class Register extends Controller {

    function Register()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $data['page_title'] = "title";
        $data['page_desc'] = "register";
        $data['page_keywords'] = "keywords";
        $this->load->view('account/register', $data);
    }
}

and i created a view page called register.php under the folder account

when i go to my site it seems to redirect me to my index page. Should my function be called register?
#2

[eluser]Dyllon[/eluser]
Your function looks fine, what is your .htaccess configuration and what is the URI you are calling?
#3

[eluser]macleodjb[/eluser]
I thought i had a grasp on this framework but now i'm confused all the hell.

this is whats in my .htaccess file

Code:
RewriteEngine on
RewriteRule ^$ /index.php [L]
RewriteCond $1 !^(index\.php|img|css|js|video_files|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

It's funny because it's grabbing a page from my site and it should be grabbing.

if i type
www.example.com = I get a different index.php
www.example.com/register = I get a different index.php

It doesn't seem like anything is working right.
#4

[eluser]macleodjb[/eluser]
answer me this...

with no mod_rewrite statements in my .htaccess file

if i create a control called help
and i create a view called help

what will my url look like

www.example.com/help ???
#5

[eluser]Dyllon[/eluser]
try removing RewriteRule ^$ /index.php [L] from your .htaccess
#6

[eluser]jalalski[/eluser]
You may want to have a read of the documentation, section General Topics -> Codeigniter URLs, that explains how they work quite nicely.

http://ellislab.com/codeigniter/user-gui.../urls.html




Theme © iAndrew 2016 - Forum software by © MyBB