开发者

Loading a view outside of Codeigniter

开发者 https://www.devze.com 2023-02-13 01:24 出处:网络
I have a view that generates a dynamic navigation bar. Within Codeigniter, I just load the View normally with $this->load->view(\'navigation\');

I have a view that generates a dynamic navigation bar.

Within Codeigniter, I just load the View normally with $this->load->view('navigation');

I'm integrating my app with another PHP app that doesn't use Codeigniter and I would like to use the same Navigation bar.

My navigation View is just a unordered list navigation with logic for user's security access and active class css styling. Which is the reason I don't want to recode the navigation again开发者_如何学JAVA.

<div class="navigation">
  <ul>
    <li class="active"><a href="main">Main</li>
    ...
    <li><a href="second">Second Page</li>
  </ul>
</div>

Is there an easy way to call up Codeigntier from an external php script and load a view? Similar to an include.


A view is just a php file with some variables in place, as long as the other app generates the proper variables needed for the security logic and information needed in the view, just include it like any other php file.

0

精彩评论

暂无评论...
验证码 换一张
取 消