Replies: 1 comment
-
Hey @ramabie! 👋🏻 It would be better to create a class or a method outside your view layer and bind it as a global. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
// this code is fine
@set('max_width', (maxWidth === 'sm') ? 'sm:max-w-sm' : 'sm:max-w-2xl')
// but how to implement it inside
edges rendered on the server side?
usually I write in php with @php ... @endphp
@set('max_width', () => {
if (maxWidth === 'sm') {
return 'sm:max-w-sm'
} else if (maxWidth === 'md') {
return 'sm:max-w-md'
} else if (maxWidth === 'lg') {
return 'sm:max-w-lg'
} else if (maxWidth === 'xl') {
return 'sm:max-w-xl'
} else if (maxWidth === '2xl') {
return 'sm:max-w-2xl'
} else if (maxWidth === '3xl') {
return 'sm:max-w-3xl'
} else () {
return 'sm:max-w-2xl'
}
})
Beta Was this translation helpful? Give feedback.
All reactions