PHPackages                             nimasystems/lightcast - 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. nimasystems/lightcast

ActiveLibrary[Framework](/categories/framework)

nimasystems/lightcast
=====================

Lightcast (TM) is a PHP MVC framework for developing applications from scratch

1.5.32(3mo ago)0733↓93.3%GPL-3.0-or-laterPHPPHP &gt;=7.1CI failing

Since Sep 18Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/nimasystems/lightcast)[ Packagist](https://packagist.org/packages/nimasystems/lightcast)[ Docs](https://github.com/nimasystems/lightcast)[ GitHub Sponsors](https://github.com/miraclebg)[ Patreon](https://www.patreon.com/miracle_bg)[ RSS](/packages/nimasystems-lightcast/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (33)Used By (0)

Lightcast PHP MVC Framework
===========================

[](#lightcast-php-mvc-framework)

**Version:** 1.5.3 | **License:** GPL-3.0-or-later | **Requires:** PHP 5.6+

Lightcast is a full-stack PHP MVC framework developed by [Nimasystems Ltd](https://www.nimasystems.com) for building enterprise-grade web applications, console tools, and web services from a single, unified codebase.

---

Highlights
----------

[](#highlights)

### MVC Architecture

[](#mvc-architecture)

Clean separation of concerns through Controllers, Views, and Models. Each module is self-contained with its own controller, templates, forms, and models.

### Multiple Execution Contexts

[](#multiple-execution-contexts)

One framework, three runtime modes:

- **Web** (`lcWebConfiguration`) — HTTP request/response cycle
- **Console** (`lcConsoleConfiguration`) — CLI task runner
- **Web Service** (`lcWebServiceConfiguration`) — API / RPC endpoint

### Multi-Application Projects

[](#multi-application-projects)

A single project can host multiple applications (e.g. `frontend`, `backend`), each with its own configuration, modules, layouts, and entry point. Each application extends `lcWebConfiguration` with its own class.

### YAML Configuration

[](#yaml-configuration)

All configuration is environment-aware YAML. Override any value per environment (`dev`, `prod`, `test`) without touching shared config. Supports `.env` variable injection (`env(VAR_NAME)`).

### Plugin System

[](#plugin-system)

Extend any application by dropping a plugin into `addons/plugins/`. Plugins are self-contained bundles that register their own models, forms, modules, components, tasks, and event listeners — with zero coupling to the host app.

### Propel ORM Integration

[](#propel-orm-integration)

First-class integration with Propel ORM for type-safe, schema-driven database access. Build schemas in XML, generate PHP models, run migrations.

### Event-Driven Core

[](#event-driven-core)

An `lcEventDispatcher` bus connects every framework component. Fire and listen to named events anywhere without hard dependencies.

### Swappable Loaders

[](#swappable-loaders)

Every system service — request, response, router, logger, cache, mailer, storage, i18n — is defined by a class name in `loaders.yml`. Swap any service without touching application code.

### Template Engine

[](#template-engine)

Built-in template engine using `{$variable}` syntax with block regions, i18n tags (`{t}...{/t}`), and partial inclusion (`\`).

### Caching Backends

[](#caching-backends)

Built-in adapters for Memcache, Redis, APC, and file-based caching. Configure once in `project.yml`, use the same cache API everywhere.

### Action Forms

[](#action-forms)

Encapsulate form validation and execution logic in dedicated `lcBaseActionForm` (or `lcModelScopeActionForm`) subclasses with a widget schema system.

### Components

[](#components)

Reusable HTML fragments via `lcHtmlComponent` subclasses, includable from any controller or template.

### Built-In Security

[](#built-in-security)

Authentication/authorization via `security.yml`, cryptography via [paragonie/halite](https://github.com/paragonie/halite) (libsodium), and role-based access control.

### Internationalization

[](#internationalization)

Database-backed or file-based i18n with `lcDbLanguageSystem`. All translatable strings flow through the `t()` shortcut, including inline template tags.

---

Architecture at a Glance
------------------------

[](#architecture-at-a-glance)

```
HTTP Request
    │
    ▼
webroot/index.php  ──►  lcFrontendConfiguration (extends lcWebConfiguration)
                                │
                          lcApp (singleton)
                                │
              ┌─────────────────┼──────────────┐
              ▼                 ▼              ▼
         lcWebRequest      lcPatternRouting   lcPluginManager
              │                 │
              └────────┬────────┘
                       ▼
             lcFrontWebController
                       │
                       ▼
           cModuleName::actionXxx()
                       │
                       ▼
              templates/action.htm
              + layouts/index.htm
                       │
                       ▼
            lcWebResponse::send()

```

---

Quick Example
-------------

[](#quick-example)

**Controller** (`app/applications/frontend/modules/home/home.php`):

```
class cHome extends lcWebController
{
    protected $use_plugins = ['core'];

    public function actionIndex()
    {
        $this->view['greeting'] = 'Hello from Lightcast!';
        return $this->render();
    }
}
```

**Template** (`app/applications/frontend/modules/home/templates/index.htm`):

```
{$greeting}
```

**Entry point** (`app/webroot/index.php`):

```
