1

Hi Is there a way to load .html file in a Codeigniter framework?

say example

public function saveimage(){
    $this->load->view("save_image_function.html");        
}

but it says "unable to load requested file" is there any settings I need to change?

Appreciate your help

Here is the screen shot of my code and the error

My CI code and folder enter image description here

Error page

enter image description here

2
  • 1
    did you place the html file in views folder? Commented Sep 19, 2016 at 4:17
  • yes, it is inside the view folder Commented Sep 20, 2016 at 3:04

1 Answer 1

1

CI can loade html file without any extra configs, please ensure that place the html file in views's folder, and the file's name is the same as what you pass into $this->load->view() method.

Check this documentation and find out does there have any mistakes in your project which are violate CI's view arrangement.

http://www.codeigniter.com/user_guide/general/views.html

EDIT:

According to the screen shot you posted on, I find your html file's extension is htm not html, So either change file's extension to html or pass the right file name with the right extension into method $this->load->view();

Sign up to request clarification or add additional context in comments.

5 Comments

can you list the view directory and take a screenshot of that? @BrandonJakeSullano
See my edit, I think it will fix the error . @BrandonJakeSullano
Will try and get back to you
Thanks! it is error between "HTML" and "HTM" i did not notice that when I save html file using php designer the extension is only "htm"! good catch ( almost broke my brain)
You're welcome , if convenient please give me a votes up :) @BrandonJakeSullano

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.