1

Anyone see any reasons why this wouldn't work in laravel 4? I figured I would check here before posting on github.

In the controller:

return View::make('home.index')
->with('bcrumbs', array("home.index" => "Home","home.privacy" =>"Privacy Policy"))

In the template:

@foreach ($bcrumbs as $k => $elem}
  <li><a href='{{ URL::route($k) }}'>{{ $elem }}</a></li>
@endforeach

Even if I remove any processing within the foreach and just write "hi", it is a total failure. Chrome reports:

Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
3
  • FYI - using the latest beta zip as of today. Commented May 19, 2013 at 4:22
  • Have you tried removing the entire @foreach loop as well to see where the problem is? Commented May 19, 2013 at 5:21
  • Yup - if I remove the loop, then the code executes fine. If I just echo out the passed in variable, the data is there as expected. I just can't loop through it. Commented May 19, 2013 at 8:30

2 Answers 2

1

I don't know if it's intentional, but you have mis-matched braces: @foreach ($bcrumbs as $k => $elem}: you're opening with ( and (not) closing with } … maybe that's it!

Sign up to request clarification or add additional context in comments.

1 Comment

I hate that I missed that. I literally poured over this and tried every permutation I could think.. That is, beyond checking the syntax was actually valid. :) Good eye!
0

This is not an answer to the problem in question but I got an ERR_EMPTY_RESPONSE with Laravel 4 on Ubuntu Server 12.04, the reason I'm posting this is that I ended up here so someone might find this usefull. The problem for me was the use of PHP's empty() function. Just changed this to if($your_var != null), this fixed my problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.