mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Added source menu
This commit is contained in:
@@ -1,34 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Creator\Factory\Form\Source;
|
||||
|
||||
use App\Entity\SourceInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class SourceFormFactory
|
||||
{
|
||||
const FORM_NAMESPACE = 'App\Form\\';
|
||||
|
||||
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
private $source;
|
||||
|
||||
public function __construct(SourceInterface $source){
|
||||
|
||||
public function __construct(SourceInterface $source)
|
||||
{
|
||||
$this->source = $source;
|
||||
}
|
||||
|
||||
public function getNamespace():string{
|
||||
|
||||
public function getNamespace(): string
|
||||
{
|
||||
return self::FORM_NAMESPACE.$this->getName();
|
||||
}
|
||||
|
||||
|
||||
protected function getName(): string
|
||||
{
|
||||
$reflectionClass = new \ReflectionClass($this->source);
|
||||
|
||||
return $reflectionClass->getShortName().'Type';
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@ class SourceTemplateFactory
|
||||
const SOURCE_TEMPLATE_ROOT = 'source';
|
||||
|
||||
const VIEW_FOLDER = 'view';
|
||||
|
||||
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
|
@@ -1,18 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Creator\Factory\Template\Source;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class SourceTemplateFormFactory extends SourceTemplateFactory
|
||||
{
|
||||
const FORM_FOLDER = 'form';
|
||||
|
||||
|
||||
public function getTemplatePath(): string
|
||||
{
|
||||
return parent::SOURCE_TEMPLATE_ROOT.'/'.self::FORM_FOLDER.'/'.$this->generateName().'.'.$this->request->getRequestFormat().'.twig';
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user