GithubHelp home page GithubHelp logo

flexmodel / flexmodelbundle Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 6.0 98 KB

FlexModel integration for Symfony 3+.

License: MIT License

PHP 66.81% HTML 2.60% XSLT 30.59%
bundle php symfony symfony-bundle

flexmodelbundle's People

Contributors

deborahvandervegt avatar niels-nijens avatar reyostallenberg avatar silvano-a avatar

Stargazers

 avatar

Watchers

 avatar  avatar

flexmodelbundle's Issues

Add the possibility to set the url to save a file to

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.

Flexmodel generates property with underscore if the field is a foreign key

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;

Make column name escaping possible / configurable

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>

FlexModelFormType misses the BirthdayType namespace

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

Make hardcoded items in generate command configurable

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:

  1. Make the values configurable in the app config (app/config/config.yml)
  2. Make the values configurable as argument/option of the command

Which is prefered and do you have a proposal for the naming?

Integer fields are not allowed to have options

<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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.