codecamp

应用说明

入口文件

index.php 存放于 test/index.php

$app = require_once "../vendor/bootstrap/initialize.php";


$app->run()->send();

调用就是如此简单。

如何与其他项目依赖共存?

例如: 有一个 A 项目 我不想更换域名 但是也想使用 coffee 并能保存原来的项目还能正常运行

如下: 使用一个标记

if($_SERVER['HTTP_VERSION'] == '2.0') { //导入新入口文件 include "../api/index.php"; } else { //Todo 你原有的项目入口配置 }

新入口文件配置如下:

define('C_ITEM',DIR.DIRECTORY_SEPARATOR);


$app = require_once "../../_api/vendor/bootstrap/initialize.php";


$app->run()->send();

是不是很简单呢? 快进行下一步试试

系统常量

C_ROOT 运行根目录
C_VENDOR 核心目录
C_ITEM 当前运行的项目目录
C_NAME 框架名称
C_VERSION 框架版本
C_EXT 通用文件后缀
目录结构
开发规范
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

应用

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }