Code Monkey home page Code Monkey logo

framework's Introduction

Prerequisites:

  • PHP 5.3
  • Web server with URL rewriting capabilities (e.g. Apache with mod-rewrite)

Download Phidias Framework

Checkout the repository into [path to framework]/

git clone https://github.com/phidiasdev/framework.git

Create a module

Available to copy [path to framework]/modules/sampleModule

Default directory structure:

sampleModule/
	configuration/
	documentation/
	initialize/
	languages/
	libraries/
	public/
	specification/
	views/

Declare a Controller

file: sampleModule/libraries/Phidias/Example/myController.php

<?php
namespace Phidias\Example;

class myController
{
	public function hello()
	{
		return "Hello";
	}
}

Declare a Resource

file: sampleModule/configuration/routes.php

<?php
use Phidias\Resource\Route;

Route::forRequest('GET example/hello')
	   ->useController(array('Phidias\Example\myController', 'hello'));

Setup Web environment

Make sampleModule/public available in a public url. (http://[localhost/myApp])

Note on redirecting URLs: Configure your web server to rewrite: http://[localhost/myApp]/example/hello -- into --> http://[localhost/myApp]/index.php?_url=example/hello

file: sampleModule/public/index.php

<?php
include '[path to framework]/loader.php';

use Phidias\Environment;

Environment::start();

Run

Browse to http://[localhost/myApp]/example/hello

Which should redirect to http://[localhost/myApp]/index.php?_url=example/hello

Output:

<h1>String</h1>
Hello

Run http://[localhost/myApp]/example/hello?__debug for details about the resource's execution

framework's People

Contributors

santiago-cortes 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.