PHPackages                             greenfly/framework - 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. greenfly/framework

ActiveLibrary[Framework](/categories/framework)

greenfly/framework
==================

Rapid CMF made for creative professionals

046PHP

Since Mar 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/StephenMiracle/greenfly-framework)[ Packagist](https://packagist.org/packages/greenfly/framework)[ RSS](/packages/greenfly-framework/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Greenfly Framework

This is the kernel behind the Greenfly site generator. It is recommended that you use the standard Greenfly package to get started as it creates a project that gets you set up quickly.

Documentation
-------------

[](#documentation)

The documentation is currently under construction.

Installation
------------

[](#installation)

### Composer

[](#composer)

Create a new project with Greenfly using composer as this is the recommended route

```
Composer create-project Greenfly/Greenfly
```

\##Basic Usage: The Greenfly Content Management Framework is built to be easily extendable and flexible to meet your needs. All you need is a JSON file that contains your page tree and a php config file to get started. Each page can reference either a view file that can use the Twig template engine or use any class static method. The framework comes with the standard content module but you can customize to meet your own needs whether extending the Greenfly module systen or using your own classes.

\###Documents.json file The documents.json file is where you will store the list of your site pages and what you want to do with them. It must follow a certain object structure that flows as such:

```
{

    "HTTP METHOD" : {

        "PAGE URL" :  ..

    }

}
```

For Example, the following would produce an acceptable documents.json file.

```
{

    "get" : {

        "/" : "home.html",

        "/about" : {

            "renderData": {"mainClass": "sampleClass "},

            "view": "about.html"

        },

        "/:type_name/:content_name" : {

            "callback" : "Greenfly\\Modules\\Content\\Content" : "contentWithRelated",

            "config" : {

                "params" : {

                    "take" : 20

                }

                "render" : {

                    "view" : "article.html",

                    "data" : { "itemClass" : "class1 class2" }

                }

            }

        }

    }

}
```

The above documents.json file would produce the following page structure:

- \[yoursite.com\]/ ==&gt; will render home.html with any site variables from the config file.
- \[yoursite.com\]/about ===&gt; Renders about.html with site variables plus items in the renderData json object.
- \[yoursite.com\]/article/my-article ===&gt; Calls the contentWithRelated method in the associated class and pass type\_name, content\_name and take as parameters for the method. It will follow by passing additional variables from the database plus the data json object in the associated render attribute to the article.html file.

\###Site.php config file The site.php config file is a php array that gets passed through Greenfly when starting the site. It contains all of the necessary items to boot up and get the framework working correctly. There are a few keys that are required in the site to function.

```
$config = [

    'site' => [

        'variables' => [                                    // variables that get passed to your html template files
            'siteName' => 'My New Site',
            'siteDescription' => 'a super amazing site ,
            'siteUrl' => http://mysite.com,
            'pageTitle' => 'my awesome website',
            'metaDescription' => 'check out my new site',
            'metaKeywords' => ''
        ],
        'database' => [                                         // The database information
              'driver'    => 'mysql',
              'database'  => 'pursesbliss',
              'username'  => 'root',
              'password'  => '',
              'charset'   => 'utf8',
              'collation' => 'utf8_unicode_ci',
              'prefix'    => '',
              'host'      => 'localhost'
                          ],
        'theme_directory' => '../themes',                       // the location where you will place your template files
        'theme_cache_directory' => '../cache'                   // the cache directory
    ]
];
```

\###public/index.php file

```
use Greenfly\App as App;

include '../vendor/autoload.php';
include '../config/site.php';

$jsonDoc = file_get_contents('../documents.json');

$app = new App($config);
$app->runDocument($jsonDoc);
```

\###themes/standard/home.html

```
{{dump()}}                               // will dump all variables allowed to be used in this file

Welcome to {{siteName}}.        // will show the siteName variable

{{siteDescription}}              // will show the siteDescription variable

Please enjoy

```

\###http parameters

All get and post parameters get pushed into the class method and / or rendered view file that can be accessed. You can see the following as an example.

[http://mysite.com/about?cat\_owner=Lary&amp;cat\_name=Killa](http://mysite.com/about?cat_owner=Lary&cat_name=Killa)

Sample view file:

```
The owner of {{cat_name}} is {{cat_owner}}
```

Sample class callback method:

```
Class MyModule {

    public static function catOwner ($config)

    {

        $catOwner = $config['params']['cat_owner'];

        $catName = $config['params']['cat_name'];

        echo $catName . 'is owned by: ' . $catOwner . ' whom is very odd.';

    }

}
```

\##Summary I hope you enjoy using Greenfly. This content framework really filled in the gap for me where the popular CMS' were too inflexible and time-consuming to fit my needs but the application frameworks were too robust and feature-rich beyond what I need. I don't think this CMF is for everyone or all sites. I think its useful for building interactive content websites and business websites. I'd recommend sticking with Wordpress if you want to create a heavy blog / article website or use a larger MVC framework such as Laravel if you need a more in-depth application.

Greenfly is designed for professional web designers and developers whom want to quickly and easily create great websites for their clients.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2d0a55b4d9c3eb42b310714b9f6f55dfddd1a33f75ac9b93de1f27c512ce8cf?d=identicon)[StephenMiracle](/maintainers/StephenMiracle)

---

Top Contributors

[![StephenMiracle](https://avatars.githubusercontent.com/u/3494356?v=4)](https://github.com/StephenMiracle "StephenMiracle (39 commits)")

### Embed Badge

![Health badge](/badges/greenfly-framework/health.svg)

```
[![Health](https://phpackages.com/badges/greenfly-framework/health.svg)](https://phpackages.com/packages/greenfly-framework)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
