PHPackages                             mistermashu/funky - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. mistermashu/funky

ActiveLibrary[Framework](/categories/framework)

mistermashu/funky
=================

A simple yet powerful web framework

0420PHP

Since Apr 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/matjlars/funky)[ Packagist](https://packagist.org/packages/mistermashu/funky)[ RSS](/packages/mistermashu-funky/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

General
=======

[](#general)

Funky is a PHP framework that makes making anything is PHP much easier.

This is the scale, where words represent everything you can do with the Funky framework: |raw---basic----simple----pretty neat-----complicated----complex----advanced-----funky|

Installation
============

[](#installation)

- first, create a new directory for your project and cd into it. for example, run `mkdir my-cool-site && cd my-cool-site`
- then, just run `composer require mistermashu/funky:dev-main && vendor/mistermashu/funky/install.sh`

The first bit of that command uses composer to download the funky package. The second bit runs the install script that basically scaffolds out some files you will need.

Usage
=====

[](#usage)

Here is a list of basic concepts of the Funky framework.

Services
--------

[](#services)

The general idea of Funky is that your "global functions" are all separated out into *services*. *services* allow you you organize your functions and easily override any logic of the whole framework on a per-site basis.

A simple service would be like this:

```
namespace services;

class greeter{
	function greet(){
		echo 'hello funky!!!';
	}
}
```

Then, to call that function from *anywhere* (yes, anywhere. within raw php pages, models, views, controllers, service functions, *actually anywhere*), you simply type:

```
f()->greeter->greet();
```

This causes the funky framework to automatically load the greeter class, instantiate it as an object and save that reference, so the second time you use f()-&gt;greeter, it is actually the same object. This is literally all the Funky framework does (which is a good thing, that means it's *very* lightweight), and from there, it's all about the great services that only get loaded if you use them. Additionally, this allows you to override any logic in the whole framework because it's all services all the way down.

All you need to do is define a service in your site and funky will automatically instantiate that new one instead of the one in the framework. If you want to keep most of the functionality of a built-in service, but make a little change or addition, simply make your service class extend the built-in one, like this:

```
