4

Heres the controller:

class HomeController extends BaseController {
    public function index() {
        return View::make('home', array('username' => 'Vaughan'));
    }
}

Here the home blade view:

{{ $username }}

Yet the view is outputting exactly this:

{{ $username }}

The variable is not being rendered. Could this be something to do with Apache or PHP?

2
  • Are other blade elements rendering? Commented Apr 19, 2014 at 21:43
  • 5
    I know it's unlikely, but does this view have the correct extension - .blade.php? Commented Apr 19, 2014 at 21:44

1 Answer 1

11

You need to name your view with blade extension:

home.blade.php

That's all.

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

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.