duanbei3747 2010-12-01 08:39
浏览 18

如何在codeigniter中制作三列模板?


I am a newbie to CI.And I want to implement a CI in a three column template manner.But I am not sure how can I implement it.The right column is static one once the user logged into the site.It contains like profile pic,Accountinfo and some other stuffs. In the middle and left columns are going to be change depend upon the user operation link on the right side.

--------------------------------------------
                 Header

Left     |    Middle       |         Right
  Pic    |                 |                
  Account|                 |

                Footer
----------------------------------------------

For example if user clicks the left side link account I need to display account information in the middle panel.So Now the middle panel only changes in content?How can I achieve this?

  • 写回答

1条回答 默认 最新

  • duang8642 2010-12-01 09:12
    关注

    just display views depending on the method requested..

    <?php
    class Profile extends Controller {
    
        function __construct()
        {
            parent::__construct();
        }
    
        function index()
        {
            $this->load->view('profile/home');
        }
    
        function messages()
        {
            $this->load->view('profile/messages');
        }
    
        function pictures()
        {
            $this->load->view('profile/pictures');
        }
    }
    

    and so on.

    however it sounds like you want to keep parts of the site the same, so it may be worth looking in to a template library which will allow you to have one layout, but be able to write to specific regions - making the app easier to maintain etc.

    see:

    http://codeigniter.com/forums/viewthread/95687/P40/

    http://philsturgeon.co.uk/code/codeigniter-template

    to summarise - code as required within your controller/model to present the correct view to the user, based on the requested method.

    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集