PHPackages                             uavn/dictator - 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. uavn/dictator

ActiveLibrary

uavn/dictator
=============

The best PHP 5.3 Admin Generator in the galaxy

3101[3 issues](https://github.com/uavn/dictator/issues)PHP

Since Jan 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/uavn/dictator)[ Packagist](https://packagist.org/packages/uavn/dictator)[ RSS](/packages/uavn-dictator/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Open source admin generator for any PHP 5.3 project.
====================================================

[](#open-source-admin-generator-for-any-php-53-project)

- Work with PDO, you can set your current project connection or create new one;
- Set items per page count;
- Multilanguage;
- Connect to any MySQL-table;
- Control fields and their view on list page;
- Edit any row, create new rows, delete, bulk delete;
- All types of relations (one-to-one, one-to-many, many-to-many);
- Upload files and images;
- Search by fields;
- Sort by fields;
- Theming.

List page: [![List page](/screen.png "List page")](/screen.png)

New (edit) row page: !\[List page\](/screen 2.png "Edit page")

Code example:

```
// Require lib
require_once 'src/Uavn/Dictator.php';

// Create PDO connection or use your project connection
$pdo = new \PDO(
  'mysql:host=localhost;dbname=dictator',
  'root', '', array(
    PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
  )
);

// Create instance of Dictator
$dictator = new \Uavn\Dictator;
$dictator
  ->setConnection($pdo)
  // Set options: ipp — items per page, others — translations.
  ->setOptions(array(
    'Actions' => 'Действия',
    'Edit' => 'Редактировать',
    'Delete' => 'Удалить',
    'New row' => 'Новая запись',
    'Edit row' => 'Редактировать запись',
    'Page' => 'Страница',
    'Sure?' => 'Уверены?',
    'Search' => 'Найти',
    'Save' => 'Сохранить',
    'List rows' => 'Все записи',
    'Saved successful' => 'Успешно сохранено',
    'ipp' => 5
  ))
  // Set table and label
  ->setTable('book', 'Книги')
  // Add fields to list and its label
  ->addField('id', 'ID')
  ->addField('pic', 'Обложка')
  ->addField('categoryId', 'Категория')
  ->addField('name', 'Название')
  ->addField('isSold', 'Продана?')
  ->addField('desc', 'Описание')
  // Third parameter — will not be showed on edit page
  ->addField('createdAt', 'Создано', false)
  ->addField('updatedAt', 'Обновлено', false)
  // Add list filters: field name and callback function
  ->addFilter('isSold', function( $isSold ) {
    return $isSold
      ? 'Да'
      : 'Нет';
  })
  ->addFilter('pic', function( $text ) {
    if ( $text ) {
      return '';
    }

    return '—';
  })
  ->addFilter('desc', function( $text ) {
    if ( $text ) {
      $substr = mb_substr($text, 0, 200, 'UTF-8');
      return $substr . '…';
    }

    return '—';
  })
  ->addFilter('createdAt', function( $text ) {
    if ( $text ) {
      return date( 'd.m.Y (H:i:s)', strtotime($text) );
    }

    return '—';
  })
  ->addFilter('updatedAt', function( $text ) {
    if ( $text ) {
      return date( 'd.m.Y (H:i:s)', strtotime($text) );
    }

    return '—';
  })
  // This field will generate input type="file" on edit page, second param — upload dir
  ->addFileWidget('pic', __DIR__ . '/upload')
  // This field will geretate textarea on edit page
  ->addTextWidget('desc')
  // This field will geretate checkbox on edit page
  ->addCheckWidget('isSold')
  // Field categoryId maps to table category will show category.name field in list and dropdown
  ->addRelation('categoryId', 'category', 'name')
  // This adds many-to-many widget on edit page:
  // Current table maps to table author,
  //  with field author.name in list and checbox set
  //  with label — Авторы
  //  connected through third table autor_book by bookId and authorId
  ->addManyToManyRelation(
    'author', 'name', 'Авторы',
    'author_book', 'bookId', 'authorId'
  )
  ->addManyToManyRelation(
    'publisher', 'name', 'Издатели',
    'publisher_book', 'bookId', 'publisherId'
  )
  // This creates search by this fields
  ->addSearch('name')
  ->addSearch('desc')
  // On Before Insert and Update event callbacks
  ->onBeforeInsert('createdAt', function() {
    return date('Y-m-d H:i:s');
  })
  ->onBeforeInsert('updatedAt', function() {
    return date('Y-m-d H:i:s');
  })

  ->onBeforeUpdate('updatedAt', function( $itemData ) {
    return date('Y-m-d H:i:s');
  })
  ;
  // This will generate table or form
  $html = $dictator->generate();

  echo $hmtl;

```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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/a55dc155b0fa668dd3fb6b2b6965c412a8a062c7a525523c830697e2b5cff2c6?d=identicon)[uavn](/maintainers/uavn)

---

Top Contributors

[![uavn](https://avatars.githubusercontent.com/u/315338?v=4)](https://github.com/uavn "uavn (70 commits)")

### Embed Badge

![Health badge](/badges/uavn-dictator/health.svg)

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

PHPackages © 2026

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