min php,minPHP---轻量级的PHP框架

这篇博客介绍了minPHP框架的目录结构,包括controllers、models、views等关键组件的位置。同时,展示了如何在Main控制器中进行数据库查询,通过Record类实现数据的选取和打印。
摘要由CSDN通过智能技术生成

来源:http://my.oschina.net/rain21/blog/477931

dcd55169119544a9983c5956171eda07.png

结构:

/app

/controllers    - where all controllers are to be placed

/models         - where all models are to be placed

/views          - where all views are to be placed

/default    - a collection of related display components

/css

/images

/javascript

/cache              - where cached views are stored (must be writable to use)

/components         - where components are placed

/config             - where configuration files are to be stored

/helpers            - where all helpers are located

/language           - each language has its own directory in here

/en_us          - the default language directory

/lib                - where all core minPHP files are located

/plugins            - where all minPHP plugins are stored

/vendors            - where vendor code is placed (i.e. third party libraries)

b3eca5613b9f5930f4f884edfe2a423b.png

数据库查询:

首先配置config/database.php

/**

* @package minPHP

* @subpackage minPHP.app.controllers

*/

class Main extends AppController {

//index

public function index(){

$user=new Record();

//$rs=$user->select()->from("user")->where("id", "=", 1)->numResults();

$rs=$user->select()->from("user")->fetchAll();

print_r($rs);

}

//show

public function show(){

echo date(‘Y-m-d H:i:s‘,time());

return false;

}

}

?>

原文:http://my.oschina.net/rain21/blog/477931

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值