PHPackages                             taviroquai/architectphp - 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. taviroquai/architectphp

ActiveLibrary[Framework](/categories/framework)

taviroquai/architectphp
=======================

Architect PHP Framework a pragmatic approach in web development

v1.0.0(12y ago)194MITPHPPHP &gt;=5.3.0

Since Jan 22Pushed 12y ago2 watchersCompare

[ Source](https://github.com/taviroquai/architect)[ Packagist](https://packagist.org/packages/taviroquai/architectphp)[ RSS](/packages/taviroquai-architectphp/feed)WikiDiscussions 1.0-stable Synced 3d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Architect PHP Framework
=======================

[](#architect-php-framework)

Architect PHP Framework uses a pragmatic and modular Web development approach. The idea is to create a small API but with the most common features in web development.

[![Latest Stable Version](https://camo.githubusercontent.com/e2386d9ef0c28b32984d1d795a29e672144552633a719bc45f1421d800ee4a62/68747470733a2f2f706f7365722e707567782e6f72672f74617669726f717561692f6172636869746563747068702f76657273696f6e2e706e67)](https://packagist.org/packages/taviroquai/architectphp)[![Build Status](https://camo.githubusercontent.com/97f040559d92eb44fb5a799c7eeca60a9fc4b9b0caaadc37b850ec0d9b93efb5/68747470733a2f2f7472617669732d63692e6f72672f74617669726f717561692f6172636869746563742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/taviroquai/architect)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/410e6e09ffd3c821895bd3692b22351b4113f7fc4c692b181b35500a02d5fe89/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74617669726f717561692f6172636869746563742f6261646765732f7175616c6974792d73636f72652e706e673f733d65626639643065623531316233656531633963656435363031353338356465613662306238613235)](https://scrutinizer-ci.com/g/taviroquai/architect/)[![Total Downloads](https://camo.githubusercontent.com/d233a70615fb75fc120319ae4fbeb21bde2e02f0aed58c1cfdf772756e82f8ee/68747470733a2f2f706f7365722e707567782e6f72672f74617669726f717561692f6172636869746563747068702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/taviroquai/architectphp)

Online Demo
-----------

[](#online-demo)

An online demo can be found in

Install
-------

[](#install)

Look at demo repository at

Main features
-------------

[](#main-features)

- Small API - You should not need to learn another language. All features can be called in the form **app()-&gt;featureName()**. Use IDE type hinting.
- Modular and Events architecture
- Theme slots configuration and Idiom strings are XML files (no programming skills required)

Common features
---------------

[](#common-features)

Most features can be called in 1 line of code, ie. **app()-&gt;featureName()**. If you prefer to use functions style, there are also core functions aliases. Se below.

- Multiple themes
- Multiple idioms
- Routes with PHP5 anonymous functions
- Events for inter-module actions
- Fluent Interface DB queries - supports MySQL, PostgreSQL and SQLite
- Flash messages
- Application logging
- Input validation and sanitization
- Generic views as shopping cart, anti-span input field, file upload, datepicker, pagination, breadcrumbs, carousel, line chart, tree view, file explorer, leaflet map, comment form, automatic table/form from database tables, image gallery, poll and text editor
- More to come...

This is an on-going work and there is not yet a stable version

Theme Configuration without programming skills
----------------------------------------------

[](#theme-configuration-without-programming-skills)

/theme/default/slots.xml

```

            LoginNavView

```

Idiom configuration without programming skills
----------------------------------------------

[](#idiom-configuration-without-programming-skills)

/idiom/en/default.xml

```

	Architect PHP Framework

```

API usage examples
------------------

[](#api-usage-examples)

All code has type hinting in ie. NetBeans IDE, so it's easy to start.

### ALIAS

[](#alias)

Architect framework is built using OOP but if you prefer to use functions code styling there are also core function aliases that may speed up development. The first letter gives an idea of what it does. Remember to use IDE type hinting to know how the alias works.

app() - **App**lication. The main gate to access features
conf() - **Conf**iguration item. Returns a configuration item
view() - Returns the generic **view** factory
help() - Returns the **help**er factory
theme() - Loads a **theme** or returns current theme
session() - Sets or gets a **session** item
redirect() - Sends **location HTTP header** and save session before exit
filter() - calls Input to **sanitize** an input param
r() - **R**oute. Adds a new route
c() - **C**ontent. Adds content to the default theme
u() - **U**RL. Returns an internal URL. Use this to generate internal URLs
m() - **M**essage. Adds a message to be shown to the user
i() - Returns all **i**nput parameters or just one from GET/POST
j() - **J**SON. Sets JSON output
o() - **O**utput. Sets the application Output, ie. a View or plain text
f() - **F**ILES. Returns a FILES entry by index
q() - **Q**uery table. Returns a Table instance to start querying
s() - **S**ecure. Returns a secured (encrypted) string
e() - **E**vent. Adds a new event
tr() - **TR**igger. Triggers the event
v() - **V**iew. Creates a new view. You can pass a template file path
l() - Layout. Creates a new layout - a view with layout slots operations

### APP

[](#app)

```
app() // returns the application instance

```

### ROUTER

[](#router)

```
r('/my/path/(:any)', function ($param) { ... }); // Adds a route callback

```

### THEME

[](#theme)

```
c('Hello World!'); // Adds content to default theme

```

### URL

[](#url)

```
u('/demo', array('param1' => 'World')); // creates an URL

```

### INPUT (GET / POST / RAW / FILES / CLI ARGS)

[](#input-get--post--raw--files--cli-args)

```
i('username'); // returns $_GET['username'] or $_POST['username']
f(0); // returns $_FILES['file'] or $_FILES['file'][0] for multiple

```

### EVENTS

[](#events)

```
e('my.event.name', function($target) { ... }); // Register an event
tr('my.event.name', $target); // Triggers an event and passes a variable

```

### CORE EVENTS

[](#core-events)

There are core events that allows to change application workflow without changing the core system. These are:

```
'arch.module.after.load'
'arch.database.load'
'arch.session.load'
'arch.theme.load'
'arch.action.before.call'
'arch.output.before.send'
'arch.session.save'
'arch.before.end'

```

### IDIOM

[](#idiom)

```
$i = help()->createIdiom();  // tries to find a default idiom by session or input
$i->loadTranslation('filename', 'optional module name'); // loads a translation file
$i->translate('key', array('key' => 'World')); // returns translated key in filename
$i->t('TITLE'); // An alias to use in templates

```

### SCREEN MESSAGES

[](#screen-messages)

```
m('An error has occured', 'css class'); // Adds a flash message
app()->flushMessages(); // Returns array. Remember to call flush in template

```

### CAPTCHA

[](#captcha)

```
$v = view()->createAntiSpam(); // returns an HTML antispam element
$v->validate(); // validates antispam code (saved in session)

```

### ENCRYPTION

[](#encryption)

```
s('secure this string'); // returns an encrypted string (crypt)

```

### REDIRECT

[](#redirect)

```
redirect('http://www.google.com'); // redirects to an url

```

### VALIDATION

[](#validation)

```
$v = help()->createValidator();
$rules[] = $v->createRule('email', 'IsEmail', 'Invalid email message);
$result = $v->validate($rules); // more rules at /src/Arch/Rule/
app()->getSession()->loadMessages($v->getMessages());

```

### HTTP

[](#http)

```
$curl = help()->createCurl('http://google.com'); // gets a Curl helper
$result = $curl->run(); // Gets the URL response
$curl->closeConnection(); // Closes the cURL handler

```

### FILE UPLOAD

[](#file-upload)

```
$v = view()->createFileUpload(); // Creates an upload field
$v->upload(f($index), '/var/www/architect/theme/data'); // uploads a file

```

### DOWNLOAD

[](#download)

```
$helper = help()->createDownload('/var/www/architect/theme/data/image.jpg');
$helper->execute(); // forces a file download

```

### DATABASE

[](#database)

```
q('user')->s()->w('id = ?', array(1))->run(); // select user where id = 1
q('user')->i(array('username' => 'admin'))->run(); // insert into user
q('user')->u(array('username' => 'guest'))->w('id = ?', array(1))->run(); // update
q('user')->d('id = ?', array(1))->run(); // delete from user where id = 1
q('user')->s('group.*')->j('usergroup', 'usergroup.id_group = group.id')->run(); // join

```

### BREADCRUMBS VIEW

[](#breadcrumbs-view)

```
view()->createBreadcrumbs(); // returns a breadcrumbs view

```

### DATEPICKER VIEW

[](#datepicker-view)

```
view()->createDatepicker(); // returns a date picker view

```

### PAGINATION VIEW

[](#pagination-view)

```
view()->createPagination(); // returns a pagination view

```

### TEXT EDITOR VIEW

[](#text-editor-view)

```
view()->createTexteditor(); // returns a text editor view

```

### POLL VIEW

[](#poll-view)

```
view()->createPoll(); // returns a poll view

```

### LINE CHART VIEW

[](#line-chart-view)

```
$data = array(
    array("x" => "2011 W27", "y" => 100),
    array("x" => "2011 W28", "y" => 500)
);
$chart = view()->createLineChart() // returns a new line chart view
    ->set('data', $data)
    ->set('labels', array('Sells'));

```

### TREE VIEW

[](#tree-view)

```
view()->createTreeView();

```

### FILE EXPLORER VIEW

[](#file-explorer-view)

```
$explorer = view()->createFileExplorer();
$explorer->setPath($path);

```

### IMAGE GALLERY VIEW

[](#image-gallery-view)

```
$gallery = view()->createImageGallery()
    ->setPath($path)
    ->setPathToUrl(conf('BASE_URL').$path); // relative url

```

### MAP VIEW

[](#map-view)

```
view()->createMap();

```

### CAROUSEL VIEW

[](#carousel-view)

```
view()->createCarousel(); // returns a carousel view

```

### COMMENT FORM VIEW

[](#comment-form-view)

```
view()->createCommentForm(); // returns a comment form view

```

### FILE UPLOAD VIEW

[](#file-upload-view)

```
view()->createFileUpload(); // returns a file upload view

```

### AUTO TABLE VIEW

[](#auto-table-view)

```
$config = array(
    'table'     => 'demo_user',
    'select'    => 'demo_user.*',
    'columns'   => array(
        array('type' => 'value', 'label' => 'Email', 'property'  => 'email'),
        array('type' => 'action',   'icon'  => 'icon-edit',
            'action' => u('/demo/crud/'), 'property' => 'id')
    )
);
$v = view()->createAutoTable(); // returns an html table view
$v->configure($config, $db);
$v->setPagination($pagination);

```

### AUTO FORM VIEW

[](#auto-form-view)

```
$config = array(
    'table'     => 'demo_user',
    'select'    => 'demo_user.*',
    'action'    => u('/demo/crud/save'),
    'items'     => array(
        array('type' => 'hidden',   'property'  => 'id'),
        array('type' => 'label',    'label' => 'Email'),
        array('type' => 'text',     'property'  => 'email'),
        array('type' => 'breakline'),
        array('type' => 'submit',   'label' => 'Save',
            'class' => 'btn btn-success inline')
    )
);
$v = view()->createAutoForm(); // returns an html form view
$v->configure($config, $db);

```

ROAD MAP (TODO)
===============

[](#road-map-todo)

January 2014 - Version 1.0.0-beta
February 2014 - Version 1.0.0

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~40 days

Total

2

Last Release

4454d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65d002e4b1bdbd2da9d44bc5f064cc13d43fa047d1e2548928136ea425a5af22?d=identicon)[taviroquai](/maintainers/taviroquai)

---

Top Contributors

[![taviroquai](https://avatars.githubusercontent.com/u/498409?v=4)](https://github.com/taviroquai "taviroquai (417 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/taviroquai-architectphp/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[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.

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

A simple API extension for DateTime.

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

PHPackages © 2026

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