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

How can I pass variables in layouts\layout.blade.php? #4

Closed
boromeusagie opened this issue May 3, 2018 · 2 comments
Closed

How can I pass variables in layouts\layout.blade.php? #4

boromeusagie opened this issue May 3, 2018 · 2 comments

Comments

@boromeusagie
Copy link

How can I pass variables in layouts\layout.blade.php?

Eg: I want to pass variable in title

@FaCuZ
Copy link
Owner

FaCuZ commented May 5, 2018

You just have to define it in the file config.php

For example, what I always use is:

'before' => function($theme)
{
	$theme->setTitle(Modules\Texts\Models\Text::get("titulo"));
},

You only need to enter the variable inside $theme->setTitle($var);

Then from the layout:

<head>
	<title>@get('title')</title>
</head>

@boromeusagie
Copy link
Author

it's work. Thank you for your package and your answer sir. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants