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

Blade's @include vs Jade's include #5

Open
imanghafoori1 opened this issue Oct 6, 2016 · 2 comments
Open

Blade's @include vs Jade's include #5

imanghafoori1 opened this issue Oct 6, 2016 · 2 comments

Comments

@imanghafoori1
Copy link

One little missing feature of laravel blade is that we can pass additional variables as the second parameter to @include in blade (as laravel docs says) but I did not find it on tale-jade-laravel.

https://laravel.com/docs/5.3/blade#including-sub-views

@include('view.name', ['some' => 'data'])

@TorbenKoehn
Copy link
Member

This is already planned in Talesoft/tale-jade#6

Now that I see someone actually interested in it, I'll hurry up on implementing it.

Until then, notice: Jade has shared scopes. Use something like

$some= 'data'
include view-name

(with $some being available in view-name.jade)
or

$viewNameData(key1='val1', key2=$val2, key3=['val4', 'val5'])
include view-name

(with $viewNameData being available in view-name.jade)

What also always works is using a mixin

mixin includeSomeView(key1, key2)
    include some-view
+includeSomeView('arg1', 'arg2')

(with $key1 and $key2 being available in some-view)

I'll update this thread when I implemented include args :)

@imanghafoori1
Copy link
Author

Very Nice.
Good lock

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