add html page to codeigniter project

Usman Ali

I crated a simple html page mypage.html. It simply post data to upload.php all this run fine.

But now I wanted to add this page in my codeigniter project. But it could not added. How I can add this page to my codeigniter project. such that I only type mypage.html in url.

this is error

404 Page Not Found

The page you requested was not found.

OllyBarca

You need to create a controller, and then load the .html template from that controller.

Example:

Create a controller called 'Page.php'. Create a function within this controller called mypage(). Within mypage(), simply load your template:

<?php

class Page extends CI_Controller {

    public function mypage()
    {
        $this->load->view('mypage.html');
    }
}

Ensure your .html template is in the 'Views' folder. Then simply access via the browser by entering localhost/page/mypage

Codeigniter provide great docs and tutorials. Check them out here http://ellislab.com/codeigniter/user-guide/tutorial/static_pages.html

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

add html page to codeigniter project

From Dev

Add a page to Login System Project

From Dev

Add a page to Login System Project

From Dev

Add HTML page in Laravel

From Dev

Add post and show it without refresh page Codeigniter?

From Dev

Using .html page views instead of .php? CodeIgniter

From Dev

CodeIgniter: AJAX returns html content of current page

From Dev

cron job return login page html in codeigniter

From Dev

cron job return login page html in codeigniter

From Dev

Add fixed bar to HTML page

From Dev

How to add javascript to HTML Page?

From Dev

Add fixed bar to HTML page

From Dev

How to add video to html page ?

From Dev

Fail to add .png to page in a OJet project

From Dev

Codeigniter project works local but not online - 404 page not found

From Dev

Add df.to_html() to existing HTML page

From Dev

How to add html styling in html page in python

From Dev

How to add html styling in html page in python

From Dev

how to add favicon to pdf in tcpdf library for my codeigniter project?

From Dev

Adding a profile.html page on my project

From Dev

CodeIgniter Pagination How to add page number as class of every <li></li>

From Dev

How to add html page to another html page by using object tag?

From Dev

CodeIgniter - Method to redirect() to another page with an extra string to output as html?

From Dev

How to set up 403 error custom html page in codeigniter

From Dev

How to add HTML headers and footers to a page?

From Dev

How to add a picture in html page in Spring application

From Dev

Add an attribute to html element with javascript on page load?

From Dev

How to add blank HTML page to Magento?

From Dev

How to add jQuery code into HTML Page

Related Related

HotTag

Archive