1. Go to this page and download the library: Download kachnitel/admin-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kachnitel / admin-bundle example snippets
use Kachnitel\AdminBundle\Attribute\Admin;
#[Admin]
class Product
{
// Your existing entity...
}
#[AsLiveComponent(name: 'App:Form:PurchaseOrder')]
final class PurchaseOrderForm extends AdminEntityForm { /* ... */ }
#[AdminColumn(editable: false)] // exclude from the form
#[AdminColumn(editable: 'entity.status != "locked"')] // conditional
#[Admin(label: 'Products', archiveExpression: 'item.isArchived()')]
class Product
{
private bool $archived = false;
public function isArchived(): bool
{
return $this->archived;
}
}
#[Admin(archiveExpression: 'item.getDeletedAt()')]
class Order
{
private ?\DateTimeImmutable $deletedAt = null;
public function getDeletedAt(): ?\DateTimeImmutable
{
return $this->deletedAt;
}
}