zoukankan      html  css  js  c++  java
  • CI 模块化显示[仿照shopex功能]

    吹牛吹上天 挂件小功能 待改进

    ============

    /application/controllers/welcome.php

     1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
     2 
     3 class game extends CI_Controller {
     4   public function index(){
     5     $this->load->helper('url');
     6     $index['title'] = "这是标题";
     7     $index['data']['1'] = array('1','2','3');
     8     $index['data']['2'] = array('11','22','33');
     9     $index['data']['3'] = array('111','222','333');
    10     $this->load->view('index',$index);
    11   }
    12 }

    /application/views/index.php

    1 <?php 
    2 $this->load->view('head');
    3 $this->load->view('body');
    4 $this->load->view('foot');
    5 ?>

    /application/views/head.php

    1 <!DOCTYPE html>
    2 <html lang="en">
    3 <head>
    4 <meta charset="utf-8">
    5 <title><?php echo $title; ?></title>
    6 </head>
    7 <body>

    /application/views/body.php----------------------------------------------

    1 <?php 
    2 $id['id']=1;
    3 $this->load->view('model_a',$id);
    4 $id['id']=2;
    5 $this->load->view('model_a',$id);
    6 $id['id']=3;
    7 $this->load->view('model_a',$id);
    8 ?>

    /application/views/foot.php

    1 </body>
    2 </html>
  • 相关阅读:
    v-cloak
    MVVM
    初识ajax
    装瓶学习法
    回调函数(call back)
    如何让学习变得纯粹?
    异步
    grep用法
    Shell中的&&与||的区别
    shell中使用>/dev/null 2>&1 丢弃信息
  • 原文地址:https://www.cnblogs.com/zhusanjie/p/3287254.html
Copyright © 2011-2022 走看看