dimanche 20 septembre 2015

How should I switch view(SP,PC) in Laravel 5

When I use Laravel4, I did following code.

#global.php

View::addNamespace('pc', base_path('pc'));
View::addNamespace('sp', base_path('sp'));

,

#TestController

function sample()
{
    if ($this->isPC()) {
        $namespace = 'pc';
    } else {
        $namespace = 'sp';
    }
    return View::make($namespace . '::sample');
}

How should I do using Laravel 5?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire