Skip to content

[Request] View composer classes #262

@Anahkiasen

Description

@Anahkiasen

Currently you can define a class as a View Composer, the problem is you can only define one class per View Composer wich clutters quickly the application with one-method files.

If would be great if you could have one class for several View Composers and then instead of having a generic compose method you could do that, just like with routes and controllers :

View::composer('myview', 'ViewComposer@myComposerMethod')

Or maybe (but that's unlikely) something that automatically parses which view to compose from the method :

View::composer('ViewComposer')

class ViewComposer
{
  public function composeView($event); // Composes the "view" View
  public function composeAnotherView($event) // Composes the "another.view" view
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions