>  기사  >  백엔드 개발  >  minPHP-轻量级的PHP框架

minPHP-轻量级的PHP框架

WBOY
WBOY원래의
2016-06-23 13:30:571213검색

github下载:https://github.com/phillipsdata/minphp


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



结构:

/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)


数据库查询:

首先配置config/database.php

<?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;	}}?>


성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.