程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> CI(CodeIgniter)框架入門教程——第二課 初始MVC

CI(CodeIgniter)框架入門教程——第二課 初始MVC

編輯:關於PHP編程

http://www.youarebug.com/forum.php?mod=viewthread&tid=105&page=1&extra=#pid142


 

 

CodeIgniterMVCMVC

 

['default_controller'] = "welcome";

 

['default_controller'] = "calculate";

 

 

<?php  ( ! ('BASEPATH')) ('No direct script access allowed'
 Calculate 
        ::
        
                ->load->view('calculate_view'

 

CICI_ControllerPHP?>CI

 

viewsphpcalculate_view.php


 
網頁計算器







        
                 
                
                        +
                        -
                        x
                        ÷
                
                 
                 
        


 

 
         = ->input->post('num1' = ->input->post('operate' = ->input->post('num2' (() && (
                 = ->calculate_model->(, , 

 

 

->load->model('calculate_model');

<?
 Calculate_model ::
         (, ,  ( == "+"  +   ( == "-"  -   ( == "x"  *   ( == "÷" &&  != 0  / 1.0 /  

 



 
網頁計算器







        
        返回首頁


 

 

 = ('num1' => 1, 'num2' => 2, 'op' => +, 'result' => 3);

 

 

 ." ".." ".." = ".."<br />";

 

 

 
         = ->input->post('num1' = ->input->post('operate' = ->input->post('num2' (() && (
                 = ->calculate_model->(, , 
                 = ('num1' => , 'num2' => , 'op' => , 'result' => 
                ->load->view('result_view', 

 

data MVCCI

 

CIMVCMVCURIajax   http://www.youarebug.com/forum.php?mod=viewthread&tid=105&page=1&extra=#pid142

 

 

 

 

 

 

 

 

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved