Giter Site home page Giter Site logo

crud-maker-bundle's Introduction

Hi there ๐Ÿ‘‹

crud-maker-bundle's People

Contributors

aymanshabarowork avatar dr-matt-smith avatar marwahaha avatar sadikoff avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crud-maker-bundle's Issues

sequence wrong in controller methods - /<entity>/new parsed as /<entity>/id for show

the NEW controller method should be BEFORE the SHOW controller method in the controller template

since
//new
is parsed by the SHOW method as
/{id = 'new'}
which then fails with an Object Not found ParamConverter annottion exception

SOLUTION:

locate the new() method BEFORE the show() method in: Controller.tpl.php

I'm new to PUll reuqests for open source stuff - but I'll try to set one one via a fork :-)

.. matt ..

wrong method for DELETE (_DELETE instead of DELETE)

_delete_form.tpl.twig currently:

<form method="post" action="{{ path('<?= $route_name; ?>_delete', {'<?= $entity_identifier; ?>':identifier}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
    <input type="hidden" name="_method" value="DELETE">
    <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ identifier) }}">
    <input type="submit" value="Delete">
</form>

should be:

<form method="post" action="{{ path('<?= $route_name; ?>_delete', {'<?= $entity_identifier; ?>':identifier}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
    <input type="hidden" name="_method" value="DELETE">
    <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ identifier) }}">
    <input type="submit" value="Delete">
</form>

i.e. method should be DELETE (with no underscore prefix)

unimplemented abstract method? - fatal error

/MakeCrud.php on line 29

!!
!! Fatal error: Class Koff\Bundle\CrudMakerBundle\Maker\MakeCrud contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Bundle\MakerBundle\MakerInterface::generate) in .../testing02_unit/vendor/koff/crud-maker-bundle/src/Maker/MakeCrud.php on line 29
!!

missing method generate() ??

handleRequest() not resulting in isSubmitted for DELETE method

clicking a DELETE button in the Edit form doesn't result in
isSubmitted() being true after a handleRequest()
so the actions to remove/flush the entity aren't executed, and no delete from DB takes place

to get this to work I had to add in a condition to submit the form, adopting example from Symfony docs

but should this be necessary?

if required, then we need to update the Generated code for the Controller ...

    public function delete(LoggerInterface $logger, Request $request, Category $category)
    {
        $logger->info('1 :: got here');

        $form = $this->createDeleteForm($category);
        $form->handleRequest($request);

        $logger->info('2 :: isSubmitted = ' . $form->isSubmitted());

        if ($request->isMethod('DELETE')) {
            $form->submit($request->request->get($form->getName()));

            if ($form->isSubmitted() && $form->isValid()) {
                $logger->info('3 :: in the DELETE bit');
                $em = $this->getDoctrine()->getManager();
                $em->remove($category);
                $em->flush();
            }
        }

Can I overwrite the twig templates?

I'd like to know if there's any way to overwrite the twig templates without having to modify the bundle you've made.

thanks and great work

partial Twig templates not created

these lines missing from MakeCrud->getFiles()

            __DIR__.'/../Resources/skeleton/templates/_form.tpl.php' => 'templates/'.$params['route_name'].'/_form.html.twig',
            __DIR__.'/../Resources/skeleton/templates/_delete_form.tpl.php' => 'templates/'.$params['route_name'].'/_delete_form.html.twig',

so Twig include error when running

.. matt ..

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.