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

[Docs] In 'Iteration' section should be reference to $parent #15

Closed
drmnk opened this issue Nov 15, 2017 · 3 comments
Closed

[Docs] In 'Iteration' section should be reference to $parent #15

drmnk opened this issue Nov 15, 2017 · 3 comments

Comments

@drmnk
Copy link

drmnk commented Nov 15, 2017

Stuck with impossibility of access to parent variables in Edge, like this:

@each(fabric in fabrics)
<h2>{{ fabric.name }} </h2>
	@each(product in products)
		@if(product.parent == fabric.id)
		<a href="/settings/product/{{product.id}}">{{ product.name }}</a>
		@endif
	@endeach
@endeach

Later on forum I got explanation that I should use $parent.fabric.id.
I came from Laravel world, where all variable accesible in all @foreach while it open.

I more like Edge way with '$parent', it's more clear, but nowhere in documentation I can't find it. Can you add reference to '$parent' on 'Conditionals' page? Something called 'nested loops' maybe.

@thetutlage
Copy link
Member

So this issue is more related to the concept missing in the docs, or you also facing the issue getting it worked?

@drmnk
Copy link
Author

drmnk commented Nov 15, 2017

Everything works great in code!
Only thing to do is add some explanation and examples to Edge docs, so the laravel-comers like me could quickly get into.

@thetutlage
Copy link
Member

Sure, even if not coming from Laravel it should be in docs 😉

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