Skip to content

Commit

Permalink
add withoutLayout helper function to view builder
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuspoehls committed Dec 10, 2023
1 parent b1c7356 commit f031ab5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/contracts/src/view/config-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ export interface ViewConfigBuilder {
* the file name of the layout file in the configured layouts folder.
*/
layout(name: string): this

/**
* Render this view without a base layout.
*/
withoutLayout(): this
}
9 changes: 9 additions & 0 deletions packages/view/src/view-config-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@ export class ViewConfigBuilder implements ViewConfigBuilderContract {
this.config.layout = name
})
}

/**
* Render this view without a base layout.
*/
withoutLayout (): this {
this.layout('')

return this
}
}

0 comments on commit f031ab5

Please sign in to comment.