0

I want to load view using constant in codeigniter , just by printing constant view should be loaded . Is it possible in codeigniter?

define('SEARCH_POP_START_TAG',$this->load->view('templates/search_pop_start_tag.php'));

1 Answer 1

2

You might want to return your view as a String, see the View documentation with returning views as data. Not sure if defining a view as a constant is the best architecture though.

As in:

$string = $this->load->view('myfile', '', TRUE);
Sign up to request clarification or add additional context in comments.

Comments

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.