PHP code example of arkschools / data-input-sheets
1. Go to this page and download the library: Download arkschools/data-input-sheets 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/ */
arkschools / data-input-sheets example snippets
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Arkschools\DataInputSheets\Bridge\Symfony\DataInputSheetsBundle(),
// ...
);
}
class CarsSpine extends Arkschools\DataInputSheets\Spine
{
private $carRepository;
public function __construct(CarRepository $carRepository)
{
parent::__construct(
'Available Cars',
[]
);
$this->carRepository = $carRepository;
}
protected function load()
{
if (empty($this->spine)) {
$this->spine = [];
$cars = $this->carRepository->findAll();
foreach ($cars as $car) {
$this->spine[$car->id()] = $car->getName();
}
asort($this->spine);
}
return $this;
}
}
class CarLists
{
public function getCarDesigns()
{
return ['Coupé', 'Sedan', 'SUV', 'Crossover'];
}
}