PHPackages                             nikomtis/phbeam - 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. nikomtis/phbeam

ActiveProject[Framework](/categories/framework)

nikomtis/phbeam
===============

Simple and fast PHP micro-framework

v1.0.0(2y ago)26MITPHPPHP &gt;=5.4

Since Dec 1Pushed 2y ago2 watchersCompare

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

READMEChangelog (4)DependenciesVersions (3)Used By (0)

PHBeam Engine
=============

[](#phbeam-engine)

PHBeam is simple and fast PHP micro-framework. It has no any admin panel. All data and config stored by PHP or JSON files.

It is good for building sites with dozens of pages and even with small product catalogs or galleries.

Requirements
------------

[](#requirements)

You need a web server with PHP &gt;= 5.4. No database required.

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

[](#installation)

PHBeam can be installed in one of the following ways:

### 1. Using Composer (Recommended):

[](#1-using-composer-recommended)

- Ensure Composer is installed.
- Run this command in the directory where you want to create your new PHBeam project: ```
    composer create-project nikomtis/phbeam myproject
    ```
- This method will automatically download PHBeam and install all necessary dependencies.

### 2. Cloning the Git Repository:

[](#2-cloning-the-git-repository)

- Clone the repository using: ```
    git clone https://github.com/nikomtis/phbeam.git myproject
    ```
- After cloning, navigate to the project directory (`cd myproject`) and run `composer install` to install dependencies.

### 3. Manual Installation:

[](#3-manual-installation)

- Download the latest version as a zip file from PHBeam Releases.
- Extract it to your desired location and manually install dependencies if necessary.

### Post-Installation Configuration:

[](#post-installation-configuration)

For all installation methods, configure your web server to use `public/index.php` as the entry point. This typically involves setting the `DocumentRoot` or equivalent directive in your web server's configuration.

Setting up your project
-----------------------

[](#setting-up-your-project)

To create a website with PHBeam Engine you should follow these steps:

- Add menus and menu items (routes)
- Fill PHP files with HTML code and meta tags for each page
- Define page layouts if you have different content structure on different pages
- Create modules with equal or similar content that appears on many pages

Let's review all these steps one by one.

### Adding routes (menu items)

[](#adding-routes-menu-items)

Any webpage can be displayed for users only if it presents in one of the menu files.

`menus/` directory stores menu files with website routes. We have one menu named `main` out of the box. Let's look into the file `main.php`:

```
` in any place of the page file (or even in other module) to render navbar.

But it will be more comfortable to use module positions.

#### Using module positions

[](#using-module-positions)

Let's upgrade our `layouts/container.php` custom layout (Bootstrap CSS classes are used):

```

```

We can use `phb_get_position_modules('sidebar')` function to check if is there any modules in `sidebar` position for current page and prevent rendering empty sidebar.

Insert `` to specify where modules should appear.

Then configure pages to use `container` layout by editing menu file or by setting `default_layout` option in `config.php` file.

And define this module for `sidebar` position in `content/home_modules.php`:

```
