Heim  >  Artikel  >  php教程  >  使用TP多年,最近自己模仿TP写了个MVC框架:JunPHP

使用TP多年,最近自己模仿TP写了个MVC框架:JunPHP

WBOY
WBOYOriginal
2016-06-07 11:34:221257Durchsuche

使用TP多年,最近自己动手模仿TP写了个MVC框架,暂时命名为JunPHP,M那块暂时还没弄好,在写数据分层,也没有引入命名空间,视图那块是使用自己写的一个微型模板引擎,暂时支持多级IF跟无线级FOREACH。异常处理机制也是模仿的TP框架。这是本人第三次写框架,也是基于前两个框架的基础上模仿的ThinkPHP,路由是一个框架的灵魂。
使用TP多年,最近自己模仿TP写了个MVC框架:JunPHP
使用TP多年,最近自己模仿TP写了个MVC框架:JunPHP
使用TP多年,最近自己模仿TP写了个MVC框架:JunPHP
使用TP多年,最近自己模仿TP写了个MVC框架:JunPHP

JunPHP总得来说支持三种路由模式:
1、普通模式
2、Path_Info模式
3、Path_SUPER模式

普通模式:http://localhost/index.php?h=分组c=控器&b=方法

Path_Info模式:http://localhost/index.php/分组/控制器/方法/GET/参数/GET/参数
还可以在底层配置文件中,修改路由分割符

Path_SUPER模式:http://localhost/index.php/分组/控制器/方法/参数/参数/参数
需要在底层配置文件中,修改路由分隔符
并且设置'Url_Array' => array('pid','id','page'),//URL模式为3时的路由GET名
'App_Name_Allow' => array('Home','Admin'),//可供访问分组的名称

AD:真正免费,域名+虚机+企业邮箱=0元

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn