Giter Site home page Giter Site logo

clearframework's Introduction

Clear Framework

Clear framework is simple MVC Object oriented framework.

How to start

  1. Copy content of sandbox folder to your DOCUMENT_ROOT
  2. Copy include folder to DOCUMENT_ROOT
  3. Copy libs folder to DOCUMENT_ROOT

How to work with Database

In index PHP is initialized global cfDb instance of Db OBject. Please specify your database connection details in config.php file.

For getting results from table use following sample.

$results = $cfDb->getResults ( "SELECT * FROM your_table;");

For inserting to table is used following sample.

$assoc = array('column_1' => 'val_1'); $cfDb->insert('your_table',$assoc);

For updating table records use following sample.

$assoc = array('column_1' => 'val_1'); $cfDb->update('your_table',$assoc,"yourid='$id'");

Working with database should be in Model part of MVC. Create Class in models folder with public static functions as model operations. See example

class Book { public static function newBook($bookName) { ... }

public static function listBooks() { ... }

}

Functions are accessed after in Controler part of MVC as... $books = Book::listBooks();

clearframework's People

Watchers

James Cloos avatar  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.