Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Add Flow\Route Attribute/Annotation #3325

Merged
merged 18 commits into from
Mar 28, 2024

Commits on Mar 15, 2024

  1. FEATURE: Add Flow\Route Attribute/Annotation

    The `Flow\Route` attribute allows to define routes directly on the affected method.
    This allows to avoid dealing with Routes.yaml in projects in simple cases where is sometimes is annoying to look up the exact syntax for that.
    
    Hint: While this is a very convenient way to add routes in project code it should not be used in libraries/packages that expect to be configured for the outside.
    In such cases the Routes.yaml is still preferred as it is easier to overwrite.
    
    Usage:
    
    ```php
    use Neos\Flow\Mvc\Controller\ActionController;
    use Neos\Flow\Annotations as Flow;
    
    class ExampleController extends ActionController
    {
        #[Flow\Route(uriPattern:'my/path', httpMethods: ['get'])]
        public function someAction(): void
        {
        }
    
        #[Flow\Route(uriPattern:'my/other/b-path', defaults: ['test' => 'b'])]
        #[Flow\Route(uriPattern:'my/other/c-path', defaults: ['test' => 'c'])]
        public function otherAction(): void
        {
        }
    }
    ```
    
    The package: `WebSupply.RouteAnnotation` by @sorenmalling implemented similar ideas earlier.
    
    Resolves: neos#2059
    mficzel committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    5ddd46a View commit details
    Browse the repository at this point in the history
  2. TASK: Refactor to include annotation routes via provider and `provi…

    …derOptions` in Settings `Neos.Flow.mvc.routes`
    
    ```
    Neos:
      Flow:
        mvc:
          routes:
            Vendor.Example:
              provider: \Neos\Flow\Mvc\Routing\RouteAnnotationRoutesProvider
              providerOptions:
                classNames:
                  - Vendor\Example\Controller\ExampleController
    ```
    mficzel committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    6877a05 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. DOCS: Document Flow\Route annotations and the Settings `Neos.Flow.m…

    …vc.routes._key__.provider | providerOptions`
    mficzel committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    e0a8e4a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4e635ca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    adaf786 View commit details
    Browse the repository at this point in the history
  4. Apply suggestions from code review

    Co-authored-by: Bastian Waidelich <[email protected]>
    mficzel and bwaidelich authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    4236241 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. Apply suggestions from code review

    Co-authored-by: Marc Henry Schultz <[email protected]>
    mficzel and mhsdesign authored Mar 22, 2024
    Configuration menu
    Copy the full SHA
    95917f8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8d073a8 View commit details
    Browse the repository at this point in the history
  3. TASK: Filter out '@Package', '@subpackage', '@controller', '@action' …

    …from defaults passed via annotation
    
    The @Format option seems to be necessary
    mficzel committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    1a0e2f3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bceedfc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    43aa1c5 View commit details
    Browse the repository at this point in the history
  6. TASK: Move check for '@Package', '@subpackage', '@controller', '@action

    …' in defaults to routes class
    mficzel committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    ff5d05d View commit details
    Browse the repository at this point in the history
  7. TASK: Make test green again

    mficzel committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    360a031 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2024

  1. Configuration menu
    Copy the full SHA
    158d4dc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    794ac4a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f8f90df View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ee8a812 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. Clarify configuration keys

    kitsunet authored Mar 28, 2024
    Configuration menu
    Copy the full SHA
    77fcaea View commit details
    Browse the repository at this point in the history