LUYA CMS Documentation

website·Indexed 33 days ago

https://luya.io

Developer guides and documentation for LUYA, a CMS built on the Yii framework. Includes detailed instructions on creating modules, extensions, and themes, as well as configuring NgRest CRUD, API endpoints, and CMS building blocks. Covers administrative UI customization, headless API access, multi-language support, and deployment synchronization.

Tokens
55.5K
Snippets
320
Records
376
Agent score
67%

What's inside LUYA

  1. Overview of Filter Chain Effects

    In Luya, an 'effect' is an array of items passed to the chain() method of a Filter. These effects are powered by the Yii 2 Imagine Extension, meaning the arguments passed to these effects correspond to the methods supported by that extension.
  2. Overview of NgRest Active Buttons

    Active Buttons (luya\admin\ngrest\base\ActiveButton) allow you to attach a button to a specific NgRest CRUD row. When clicked, the button triggers a handler that can interact with the associated Active Record class.

    Common built-in Active Buttons include:

    • luya\admin\buttons\DuplicateActiveButton: Duplicates a record.
    • luya\admin\buttons\TimestampActiveButton: Manages timestamps.
    • luya\admin\buttons\ToggleStatusActiveButton: Toggles the status of a record.
  3. Overview of LUYA Admin Module capabilities

    The Admin Module allows developers to quickly create admin UI sections for data management. It supports two primary rendering methods: NgRest (for CRUD operations based on Active Records using AngularJS and Yii 2) and MVC (for custom data display using controllers and view files). Additional integrated features include a storage system for file/image uploads, a permissions system for UI menus, and API support.
  4. Overview of LUYA Core

    LUYA core is an extension of the Yii 2 Framework that provides helpers and a structured approach for building web applications. It is designed to maintain a consistent codebase across different project types, whether the application requires a full CMS, just an administration UI for data management, or a simple MVC structure provided by Yii.
  5. Overview of LUYA Admin Queue/Scheduler

    The LUYA admin module includes a built-in queue system (referred to as the scheduler in the admin context) based on the yii\queue\db\Queue database integration. It is registered as the adminqueue component. This system is used for scheduling jobs, including built-in support for scheduling changes in dropdowns (Select) and checkboxes (ToggleStatus).
  6. Use Bootstrap 4 styles in LUYA admin

    All Bootstrap 4 CSS styles and classes are natively accessible and can be used throughout the LUYA admin interface.
  7. Use NgRest Attribute Plugins to define input types

    In NgRest, an luya\admin\ngrest\base\Plugin defines the type of an input field. This allows you to implement specific UI components and behaviors such as selects, date pickers, and file or image uploaders. Each plugin can have its own set of configuration options. To implement these plugins, refer to the NgRestModel configuration.
  8. Deploy LUYA in a stateless cloud environment

    To scale LUYA across multiple pods (e.g., in Kubernetes) and ensure a stateless context where users can jump between webservers without session loss, you must externalize the following three components:

    1. Database: Centralized database for application data.
    2. Caching Server: A shared caching system (e.g., Memcached) is strongly recommended so that a single request can warm the cache for all webservers.
    3. S3-compatible Storage: Used for file uploads and assets, typically acting as a CDN.
  9. LUYA Technical Architecture and Capabilities

    LUYA is a modular system built on the Yii framework, designed for developers using version control (VCS) and deployment tools rather than graphical web-installers. Key technical capabilities include:

    • Headless Operation: Based on APIs, allowing access via any HTTP client.
    • API Management: Supports the creation of API Users to restrict content access to specific groups or users.
    • SDK Generation: Can generate OpenAPI files on the fly to create client SDKs or API documentation.
    • Modular Installation: The Administration Module can be installed independently of the CMS for projects requiring only CRUD and API functionality.
    • Error Tracking: Includes a dedicated Error Module to centralize bug tracking across multiple projects.
    • Remote Administration: LUYA Remote Admin provides a centralized control panel for agencies to monitor multiple LUYA applications and automate customer notifications.
  10. Manage headless access using LUYA API Users

    LUYA provides a dedicated API User layer for headless access to database content. API Users differ from standard users in several ways: they use viewable and revocable Access Tokens, their requests can be tracked for debugging, they do not generate log entries by default to prevent log flooding, and they are prohibited from logging into the admin UI. API Users can be assigned to zero, one, or multiple permission groups to control data access.
  11. Integrate Frontend Modules into the CMS

    When a module is included in the CMS, the rendering of the module's view file automatically ignores the layout to prevent nested HTML layout issues. To apply a consistent look across module controller views, use frontend sub-layouts.
  12. Understand LUYA CMS core architectural principles

    LUYA is a CMS built on several distinct architectural principles that differentiate it from traditional platforms like WordPress:

    • Installation: It is not a one-click installation product; it requires a manual setup process.
    • Configuration: Configuration data is stored in versioned files instead of the database, facilitating better version control and deployment workflows.
    • DRY Principle: The system strictly adheres to the "Don't Repeat Yourself" (DRY) philosophy to ensure maintainability and efficiency.
    • Code Organization: System code is managed within the vendor directory to maintain a structured environment.