Help with view

Asked

Viewed 50 times

1

I need to show two categories in one view. I tried the way below, but without success:

public function index()
{
    return View::make('Titles.IndexFutebol')->withType('time1')->withType('time2');

}

only shows type time2.

  • 1

    What version of Laravel?

  • 1

    Laravel version is 4.2

  • 1

    Have you tried with View::make('Titles.IndexFutebol')->with('time1', $time1)->with('time2', $time2); ?

  • 1

    public Function index() { $time1= Title::Where('type', 'Athltico'); $time2= Title::Where('type', 'cruzeiro'); Return View::make('Titles.Indexfootball')->with('type', $time1)->with('type', $time2); }

  • 1

    and so app.viewModels.Titles.index.start('cruise','Athltico');

  • 1

    You can’t repeat the name type

  • 1

    Return View::make('Titles.Indexfutebol')->with('type', $time1,$time2); only shows $time2

Show 2 more comments

1 answer

0

From what I read in the comments you are using version 4.2 of the Standard (does not consider gives an upgrade?).

Try it this way:

public function index()
{
    return View::make('Titles.IndexFutebol')->with('type', $time1, $time2);

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.