flexmodel / flexmodelbundle Goto Github PK
View Code? Open in Web Editor NEWFlexModel integration for Symfony 3+.
License: MIT License
FlexModel integration for Symfony 3+.
License: MIT License
There is no example on how a FlexModel configuration file could look like.
What is the structure of the file? What are all the possible fields? How can I use configuration data after generation?
Should write in an other custom directory, preferably configurable.
For file uploads you need to implement the following code for every field:
$file = $profile->getPhoto();
if ($file instanceof UploadedFile) {
$fileName = md5(uniqid()).'.'.$file->guessExtension();
$profilesDir = sprintf('%s/../../data/%s/profile/photo', $this->container->getParameter('kernel.root_dir'), $this->container->getParameter('kernel.environment'));
$file->move($profilesDir, $fileName);
$profile->setPhoto($fileName);
}
I'd like the FlexModelBundle to provide this file uploading functionality out of the box.
If an underscore is being used in a field and that field is a foreign key to another object, like in the next example, Flexmodel generates a property in the Entity which also contains an underscore.
<field name='object_created_by' label='Gereserveerd door' datatype='OBJECT.User'/>
/**
* @var User
*/
private $object_created_by;
If the field is not a foreign key and an underscore is being used the property looks like:
<field name='object_created_at' label='Gereserveerd op' datatype='DATETIME'/>
/**
* @var DateTime
*/
private $objectCreatedAt;
You should be able to configure column name escaping in the <orm>
node of the FlexModel configuration resulting in all fields in an entity being escaped with that / those characters.
<orm table='fos_user' columnEscapeCharacter='`'>
...
</orm>
It would be nice to configure these tags.
https://github.com/FlexModel/FlexModelBundle/blob/master/Form/Type/FlexModelFormType.php#L190
var_dump($fieldType);
if (in_array($fieldType, array(ChoiceType::class, DateType::class, BirthdayType::class, DateTimeType::class))) {
var_dump($fieldType) returns:
string 'Symfony\Component\Form\Extension\Core\Type\BirthdayType' (length=55)
string 'Symfony\Component\Form\Extension\Core\Type\ChoiceType' (length=53)
var_dump(BirthdayType::class) returns:
FlexModel\FlexModelBundle\Form\Type\BirthdayType
The test doesn't match the correct namespace
The command flexmodel:generate is only usable in some kind of 'default' Symfony setup.
In order to make it more flexible I think the following should be done:
There are 2 solutions:
Which is prefered and do you have a proposal for the naming?
<field name='from_month' label='Maand' datatype='INTEGER' required='false'>
<options>
<option label='' value=''/>
<option label='Januari' value='1'/>
<option label='Februari' value='2'/>
<option label='Maart' value='3'/>
<option label='April' value='4'/>
<option label='Mei' value='5'/>
<option label='Juni' value='6'/>
<option label='Juli' value='7'/>
<option label='Augustus' value='8'/>
<option label='September' value='9'/>
<option label='Oktober' value='10'/>
<option label='November' value='11'/>
<option label='December' value='12'/>
</options>
</field>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.