Blogger Information
Blog 14
fans 0
comment 0
visits 16140
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
路由的绑定
依然很m丶的博客
Original
938 people have browsed it

控制器 demo.phpn内容

<?php
namespace app\index\controller;
class Demo
{
    public function add($n,$m)
    {
        return $n.'+'.$m.'='.($n+$m);
    }
    public function sub($n,$m)
    {
        return $n.'-'.$m.'='.($n-$m);
    }
    public function mul($n,$m)
    {
        return $n.'*'.$m.'='.($n*$m);
    }
    public function div($n,$m)
    {
        return $n.'/'.$m.'='.round(($n/$m),2);
    }
}



route.php文件内容

//绑定的命名空间   http://www.tp5.com/demo/div/1/1

think\Route::bind('app\index\controller','namespace');


//绑定到类        http://www.tp5.com/div/1/1

think\Route::bind('app\index\controller\Demo','class');


//绑定到模块      http://www.tp5.com/demo/add/1/1

think\Route::bind('index');


//绑定到控制器     http://www.tp5.com/add/1/1

think\Route::bind('index/Demo');


//绑定到操作       http://www.tp5.com//1/1

think\Route::bind('index/Demo/add');


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post