1. Go to this page and download the library: Download mheads/yii2-table 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/ */
declare(strict_types=1);
namespace app\actions;
use app\tables\ProductsTableFactory;
use Mheads\Yii\Table\Http\Orchestrator\TableHttpOrchestrator;
use Mheads\Yii\Table\Provider\TableConfiguratorInterface;
use Mheads\Yii\Table\Provider\TableProviderInterface;
use Mheads\Yii2\Table\Http\TableAction;
use Mheads\Yii2Psr7Bridge\HttpMessageBridgeInterface;
use yii\web\Controller;
final class ProductsTableAction extends TableAction
{
public function __construct(
string $id,
Controller $controller,
TableHttpOrchestrator $orchestrator,
HttpMessageBridgeInterface $bridge,
private readonly ProductsTableFactory $tableFactory,
array $config = [],
) {
parent::__construct($id, $controller, $orchestrator, $bridge, $config);
}
protected function createTable(): TableProviderInterface&TableConfiguratorInterface
{
return $this->tableFactory->create();
}
}
public function actions(): array
{
return [
'table' => [
'class' => \app\actions\ProductsTableAction::class,
],
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.