Code Monkey home page Code Monkey logo

pt's Introduction

pt

######A simple / native PHP Framework to do something PHP is not good at.

Introduction

This PHP framework is tentative. I hope it can provide more possibilities about PHP framework's develop.
#####1. A especial base class It can make subclass have prototype like javascript. So you can update your project with less code.

class a extends base
{
	protected $a = 'hello';

	public function __construct($config=array()){ }
}

class b extends a
{
	public function __construct($config=array()){ }

	public function say()
	{
		echo $this -> a;
	}

	public function change()
	{
		$this -> a = ' world';
	}
}

$a = new a();
$a -> extend('b'); 		// like prototype

$a -> say();			// output: hello
$a -> change();
$a -> say();			// output: world

#####2. Integrated Action / Filter class like wordpress They are very useful in project. so pt integrated them.

#####3. More... You can read pt's code after read "How to use". This is a simple framework, you will like to use and bulid it by yourself.
Welcome everyone to make it better. :)

How To Use

This is a multi-entry framework. You only need include common.php in your file.
Documents is building... :P

// session start
define("SESSION_ON", true);

// define framework config
define("CONFIG", '/conf/web.php');

// debug switch
define("DEBUG", true);

// include common
include('./common.php');

// include project common functions
include(COMMON_PATH.'web_func.php');

/* -----v----- your code -----v----- */

$db = db(config('db'));

$news = $db -> prepare("SELECT * FROM `news` WHERE `id`=:id") -> execute(array(':id'=>1));

template::assign('news', $news[0]);
template::display('login', true);

Change Log

######Alpha 0.1

	Date: 2014-10-06
	Contributor: nolan
	* This is the first version.

pt's People

Contributors

page7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.