Open imanghafoori1 opened 8 years ago
This is already planned in https://github.com/Talesoft/tale-jade/issues/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 :)
Very Nice. Good lock
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'])