Support the ongoing development of Laravel.io →
Requests Views Blade
Last updated 2 years ago.
0

The method View::make accepts two arguemnts:

  1. View name ("about")
  2. An array of variables
return View::make('about', compact('title'));
// or
return View::make('about', ['title' => $title]);
// or
return View::make('about')->with('title', $title);
// or
return View::make('about')->withTitle($title);

All these do the same ;D

Last updated 2 years ago.
0

Hi,

I tried them but I got this error msg: Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException

if (!is_null($route)) {
        
return $route->bind($request);

  }

    $others = $this->checkForAlternateVerbs($request);

    if (count($others) > 0) {

        return $this->getOtherMethodsRoute($request, $others);

    }
    throw new NotFoundHttpException();
}
protected function checkForAlternateVerbs($request)

Not sure whats wrong.

hc.

Last updated 2 years ago.
0

How do you set your ~~~ $title ~~~ variable?

Last updated 2 years ago.
0

I'm so sorry, it actually works. I got typo somewhere on the code.

Thanks for helping.

Hc.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

chanjay chanjay Joined 30 May 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.