Giter Site home page Giter Site logo

mvc.splash's Introduction

mvc.splash's People

Contributors

camklcbr avatar cbalda avatar homersimpsons avatar hugoaverty avatar moufmouf avatar nguyenk avatar qingsun avatar thibbal avatar vaidiep avatar wizmik avatar xhuberty avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mvc.splash's Issues

Missing PSR-4 support for Controller generator

When using PSR-4 in main composer, we get a warning message on "new controller" interface of Mouf : Warning! Splash could not detect the autoload section of your composer.json file. Unless you are developing your own autoload system, you should configure composer.json to define a source directory and a root namespace using PSR-0.

Controller generation with empty redirect

Try to create a new controller, using the UI, and for the action, leave an empty "redirect" field.

You will get a buggy generated PHP file, with this:

    header("Location: <br />

( ! ) Notice: Undefined index: redirect in /home/david/projects/wabel/workspace.drupal/vendor/mouf/mouf/vendor/mouf/mvc.splash-common/src/Mouf/Mvc/Splash/Controllers/Admin/SplashCreateControllerController.php on line 358
Call Stack
#TimeMemoryFunctionLocation
10.0000240760{main}( )../mouf_router.php:0
20.0001241832require( '/home/david/projects/wabel/workspace.drupal/vendor/mouf/mouf/vendor/mouf/mvc.splash/src/splash.php' )../mouf_router.php:13
30.01162104256Mouf\Mvc\Splash\Splash->route( )../splash.php:24
40.09032967712call_user_func_array ( )../Splash.php:258
50.09032968712Mouf\Mvc\Splash\Controllers\Admin\SplashCreateControllerController->generate( )../Splash.php:258
");

allow to customize .htaccess file

As .htaccess is generic and so often part of the committed files, it would be nice to allow adding custom rules / redirections ... as an example, add a "Force HTTPS" directive, or page redirects in case of site migration, ...

Error with CSRF_ALLOWED_DOMAIN_NAMES

During the installation process, the instance "TheCodingMachine\Middlewares\CsrfHeaderCheckMiddleware" is created before the config variable "CSRF_ALLOWED_DOMAIN_NAMES".
This result an error "Undefined constant .." in the Mouf status page

We must save this instance again (i.e. after the config variable "CSRF_ALLOWED_DOMAIN_NAMES" is set) to solve the error.

HTTP Code 400 for Missing Parameters ?

If a parameter is not passed when calling an URL, an exception, "Missing Parameter", is thrown which returns a 500 HTTP error. I think that it would be preferable to return a 400 HTTP error "Bad request" because it is a client error, not a server one. Similarly, we can do the same thing for the malformed parameters.

Furthermore, I think that we should return a 405 HTTP error "Method Not Allowed" if the URL exists but not for the method used (GET, PUT, POST, ..).

Specify custom 404 page

It sould be interesting to be able to specify our own custom 404 page whitout having to rewrite the controller.

We should add properties to the HttpErrorController (that implements Http404HandlerInterface, Http500HandlerInterface and Scopabel) to specify the path of our 404 view or even a HTMLElementInterface to be directly inegrated.

[Doc] The documentation about URL params miss some points

Hi,

I read the doc and I think some points are missing : you don't talk about the way to call parameters with the @url param like this :

@url /test/{var1}/{var2}

Plus, you don't talk about the @get and @post annotation too.

You should mention that we must flush "RED" cache in Mouf BO when we change URL in any controller in order that the change can be applied.

We can also say, with a screenshot for example, that we have a recap of all our URL in the Mouf backoffice, just to check if it is taken in account.

I think these points has to be explain to play well with url parameters in Splash ! :)

Good luck !

Add a support to auto-generate PHPUnit tests

When a controller is generated, it might be a good idea to autogenerate a PHPUnit class to test the controller.

Note: this would probably require to create a mouf/phpunit package that automatically sets up unit tests.

Splash 7: add a "weak" mode

Splash 7 current behaviour is "strict": if some output is performed or nothing is returned from a controller, it triggers an error.

It could be good to weaken this behaviour in development (to get notices, warnings, etc...) or to ease migration (especially in the case of Mouf modules)

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.