<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kunicmarko / simple-configuration-bundle example snippets
$bundles = array(
// ...
new KunicMarko\SimpleConfigurationBundle\SimpleConfigurationBundle(),
);
namespace YourBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KunicMarko\SimpleConfigurationBundle\Entity\AbstractConfigurationType;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Component\Form\Extension\Core\Type\DateType;
class NewType extends AbstractConfigurationType
{
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="date", nullable=true)
*/
private $date;
public function setDate(?\DateTime $date) : self
{
$this->date = $date;
return $this;
}
public function getDate() : ?\DateTime
{
return $this->date;
}
public function getValue() : ?\DateTime
{
return $this->getDate();
}
/**
* {@inheritDoc}
*/
public function getTemplate() : string
{
//return 'SonataAdminBundle:CRUD:list_string.html.twig'; can also be used
return 'SimpleConfigurationBundle:CRUD:list_field_date.html.twig';
}
/**
* {@inheritDoc}
*/
public function generateFormField(FormMapper $formMapper) : void
{
$formMapper->add('date', DateType::class, ['
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.