Z-PHP_v4


常量

<h1>绝对路径</h1> <ul> <li><strong>P_IN</strong>:&emsp; 项目入口文件所在的目录</li> <li><strong>P_LOG</strong>:&emsp; 日志文件目录</li> <li><strong>P_PUBLIC</strong>:&emsp; 项目public目录</li> <li><strong>P_CORE</strong>:&emsp; 框架core目录</li> <li><strong>P_ROOT</strong>:&emsp; 项目根目录</li> <li><strong>P_COMMON</strong>:&emsp; 项目common目录</li> <li><strong>P_TMP</strong>:&emsp; 项目临时文件目录</li> <li><strong>P_APP</strong>:&emsp; 当前的应用目录</li> <li><strong>P_MODULE</strong>:&emsp; 当前的模块目录</li> <li> <p><strong>P_BASE</strong>:&emsp; 当前应用或者模块的 base 目录</p> </li> <li><strong>P_RES</strong>:&emsp; 项目资源目录</li> <li><strong>P_RES_APP</strong>:&emsp; 当前应用的资源目录</li> <li><strong>P_RES_VER</strong>:&emsp; 当前应用版本的资源目录</li> <li> <p><strong>P_RES_MODULE</strong>:&emsp; 当前模块的资源目录</p> </li> <li><strong>P_RUN</strong>:&emsp; 项目运行目录</li> <li><strong>P_RUN_APP</strong>:&emsp; 当前应用的运行目录</li> <li><strong>P_RUN_VER</strong>:&emsp; 当前应用版本的运行目录</li> <li> <p><strong>P_RUN_MODULE</strong>:&emsp; 当前模块的运行目录</p> </li> <li><strong>P_HTML</strong>:&emsp; 项目html缓存目录</li> <li><strong>P_HTML_APP</strong>:&emsp; 当前应用的html缓存目录</li> <li><strong>P_HTML_VER</strong>:&emsp; 当前应用版本的html缓存目录</li> <li> <p><strong>P_HTML_MODULE</strong>:&emsp; 当前模块的html缓存目录</p> </li> <li><strong>P_CACHE</strong>:&emsp; 项目缓存目录</li> <li><strong>P_CACHE_APP</strong>:&emsp; 当前应用的缓存目录</li> <li><strong>P_CACHE_VER</strong>:&emsp; 当前应用版本的缓存目录</li> <li> <p><strong>P_CACHE_MODULE</strong>:&emsp; 当前模块的缓存目录</p> </li> <li><strong>P_VIEW_APP</strong>:&emsp; 当前应用版本的模板目录</li> <li> <p><strong>P_VIEW_MODULE</strong>:&emsp; 当前模块的模板目录</p> </li> <li><strong>P_THEME_APP</strong>:&emsp; 当前应用版本的模板风格目录</li> <li> <p><strong>P_THEME_MODULE</strong>:&emsp; 当前模块的模板风格目录</p> </li> <li><strong>P_RES_</strong>:&emsp; 当前的资源目录&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块的资源目录否则就是应用版本的资源目录]</strong></li> <li><strong>P_RUN_</strong>:&emsp; 当前的运行目录&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块的运行目录否则就是应用版本的资源目录]</strong></li> <li><strong>P_HTML_</strong>:&emsp; 当前的html缓存目录&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块的html缓存目录否则就是应用版本的html缓存目录]</strong></li> <li><strong>P_CACHE_</strong>:&emsp; 当前缓存目录&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块的缓存目录否则就是应用版本的缓存目录]</strong></li> <li><strong>P_VIEW_</strong>:&emsp; 当前模板目录&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块的模板目录否则就是应用版本的模板目录]</strong></li> <li><strong>P_THEME_</strong>:&emsp; 当前模板风格目录&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块的模板风格目录否则就是应用版本的模板风格目录]</strong></li> </ul> <h1>相对路径</h1> <ul> <li><strong>U_ROOT</strong>:&emsp; URL的根路径&emsp; <strong>[结尾无“/”]</strong></li> <li><strong>U_HOME</strong>:&emsp; URL的根路径&emsp; <strong>[结尾有“/”]</strong></li> <li><strong>U_TMP</strong>:&emsp; 临时目录的URL路径 (public目录下的tmp)</li> <li><strong>U_RES</strong>:&emsp; 资源目录的URL</li> <li><strong>U_RES_APP</strong>:&emsp; 当前应用资源目录的URL</li> <li><strong>U_RES_VER</strong>:&emsp; 当前应用版本资源目录的URL</li> <li><strong>U_RES_MODULE</strong>:&emsp; 当前模块资源目录的URL</li> <li><strong>U_RES_</strong>:&emsp; 当前资源目录的URL&emsp; <font color=red>下划线结尾</font>&emsp;<strong>[有模块功能就是模块资源目录的URL,否则就是应用版本资源目录的URL</strong></li> </ul> <h1>其它常量</h1> <ul> <li><strong>ZPHP_OS</strong>:&emsp; 操作系统(只有WINDOWS和LINUX)</li> <li><strong>ZPHP_VER</strong>:&emsp; 框架版本号</li> <li><strong>PHP_FILE</strong>:&emsp; 入口文件名</li> <li><strong>VER</strong>:&emsp; 项目的版本号</li> <li><strong>TIME</strong>:&emsp; 请求时间(秒)</li> <li><strong>MTIME</strong>:&emsp; 请求时间(微秒)</li> <li><strong>THEME</strong>:&emsp; 模板风格</li> <li><strong>TPL_EXT</strong>:&emsp; 模板文件的扩展名</li> <li><strong>METHOD</strong>:&emsp; 请求方式</li> <li><strong>APP_NAME</strong> :&emsp; 应用名</li> <li><strong>IS_AJAX</strong>:&emsp; 是否ajax请求</li> <li><strong>IS_WX</strong>:&emsp; 是否微信浏览器</li> <li><strong>ROUTE</strong>:&emsp; 当前请求的路由信息&emsp;<strong>[数组,结构见下面]</strong></li> <li><strong>DATA</strong>:&emsp; 当前请求提交的数据&emsp;<strong>[数组,结构见下面]</strong></li> </ul> <p><strong>ROUTE 结构:</strong></p> <table> <thead> <tr> <th>key</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>module</td> <td>string</td> <td>模块名 (启用了模块的情况下,否则无此字段)</td> </tr> <tr> <td>ctrl</td> <td>string</td> <td>控制器名</td> </tr> <tr> <td>act</td> <td>string</td> <td>操作名</td> </tr> <tr> <td>path</td> <td>array</td> <td>pathinfo部分拆分为数组</td> </tr> <tr> <td>params</td> <td>array</td> <td>pathinfo或路由模式传递的参数</td> </tr> <tr> <td>query</td> <td>array</td> <td>包含 params 和 $_GET</td> </tr> <tr> <td>uri</td> <td>string</td> <td>请求的uri</td> </tr> </tbody> </table> <p><strong>DATA 结构:</strong> <font color=red>[字段根据请求类型而变,下面只是举例]</font></p> <table> <thead> <tr> <th>key</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>INPUT</td> <td>string</td> <td>未知类型的提交数据</td> </tr> <tr> <td>PUT</td> <td>-</td> <td>PUT操作提交的数据</td> </tr> <tr> <td>DELETE</td> <td>-</td> <td>DELETE操作提交的数据</td> </tr> <tr> <td>PATCH</td> <td>-</td> <td>PATCH操作提交的数据</td> </tr> </tbody> </table>

页面列表

ITEM_HTML