Support the ongoing development of Laravel.io →
posted 10 years ago
Blade Forms
Last updated 2 years ago.
0

I guess your $var is an array, so you could access its keys like this:

URL::route('find-category', array('category' => $var['category'] ))
Last updated 2 years ago.
0

2u3 said:

I guess your $var is an array, so you could access its keys like this:

URL::route('find-category', array('category' => $var['category'] ))

Cannot use object of type stdClass as array - any other solutions?

Last updated 2 years ago.
0
Solution

Hm, I don't get it. So I understand that you have an array containing multiple stdClass objects, and you should be able to access them like this:

URL::route('find-category', array('category' => $var->category ))

Edit : my previous example was in case you have an multidimensional array (array of arrays)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Panoply panoply Joined 27 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.