Example #1
0
function smart_view($view, $default = 'default')
{
    if (is_mobile() && ($m = FrameFile::view('mobile/' . $view)) && file_exists($m)) {
        return $m;
    }
    if (($file = FrameFile::view($view)) && file_exists($file)) {
        return FrameFile::view($view);
    }
    throw new Exception("not exist {$file}");
}