当前位置: 首页>>代码示例>>PHP>>正文


PHP layout函数代码示例

本文整理汇总了PHP中layout函数的典型用法代码示例。如果您正苦于以下问题:PHP layout函数的具体用法?PHP layout怎么用?PHP layout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了layout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: before

function before()
{
    layout('layouts/default.html.php');
    /*set('header', '
          <a href="'.url_for().'">Home</a>
          <a href="'.url_for('people').'">Personen</a>
          <a href="'.url_for('roles').'">Rollen</a>
          <a href="'.url_for('access').'">Zugriff</a>
          <a href="'.url_for('servers').'">Server</a>
          <a href="'.url_for('daemons').'">Daemons</a>
      ');*/
    set('header', '
        <img id="header_img" src="img/aclmodel.png" width="850" height="83" usemap="#head_nav" alt="header_navigation">
        <map name="head_nav">
            <area id="daemons_nav" shape="rect" href="' . url_for('daemons') . '" coords="682,7,781,28" alt="daemons">
            <area id="servers_nav" shape="rect" href="' . url_for('servers') . '" coords="516,7,635,28" alt="servers">
            <area id="access_nav" shape="rect" href="' . url_for('access') . '" coords="391,7,478,28" alt="access">
            <area id="roles_nav" shape="rect" href="' . url_for('roles') . '" coords="239,7,340,28" alt="roles">
            <area id="people_nav" shape="rect" href="' . url_for('people') . '" coords="74,7,193,28" alt="people">
            <area id="clients_nav" shape="rect" href="' . url_for('clients') . '" coords="2,55,98,76" alt="clients">
            <area id="people_roles_nav" shape="rect" href="' . url_for('people_roles') . '" coords="176,54,267,75" alt="people_roles">
            <area id="ports_nav" shape="rect" href="' . url_for('ports') . '" coords="748,55,849,76" alt="ports">
        </map>
    ');
    set('footer', '&copy; 2011 - Florian Staudacher (Frontend), Alexander Philipp Lintenhofer (Backend)');
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:26,代码来源:config.inc.php

示例2: ueditor

 public function ueditor()
 {
     $data = new \Org\Util\Ueditor();
     layout(false);
     C('SHOW_PAGE_TRACE', false);
     echo $data->output();
 }
开发者ID:bjjfsd,项目名称:CMS-TP,代码行数:7,代码来源:ToolController.class.php

示例3: adminuser

function adminuser($lang, $arglist = false)
{
    if (!user_has_role('administrator')) {
        return run('error/unauthorized', $lang);
    }
    $user_id = false;
    if (is_array($arglist)) {
        if (isset($arglist[0])) {
            $user_id = $arglist[0];
        }
    }
    if (!$user_id) {
        return run('error/notfound', $lang);
    }
    $user_id = user_id($user_id);
    if (!$user_id) {
        return run('error/notfound', $lang);
    }
    $useredit = build('useredit', $lang, $user_id);
    if ($useredit === false) {
        return redirect('admin', $lang);
    }
    head('title', translate('admin:title', $lang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $admin = true;
    $banner = build('banner', $lang, compact('admin'));
    $content = view('adminuser', $lang, compact('useredit'));
    $output = layout('standard', compact('banner', 'content'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:32,代码来源:adminuser.php

示例4: homepage

function homepage($lang)
{
    global $sitename, $siteshot;
    $page_contents = build('content', $lang, 'homepage');
    $besocial = $sharebar = false;
    $ilike = true;
    $tweetit = true;
    $plusone = true;
    $linkedin = true;
    $pinit = true;
    if ($tweetit or $pinit) {
        $description = translate('description', $lang);
        if ($tweetit) {
            $tweet_text = $description ? $description : $sitename;
            $tweetit = $tweet_text ? compact('tweet_text') : true;
        }
        if ($pinit) {
            $pinit_text = $description ? $description : $sitename;
            $pinit_image = $siteshot;
            $pinit = $pinit_text && $pinit_image ? compact('pinit_text', 'pinit_image') : false;
        }
    }
    list($besocial, $sharebar) = socialize($lang, compact('ilike', 'tweetit', 'plusone', 'linkedin', 'pinit'));
    $content = view('anypage', false, compact('page_contents', 'besocial'));
    head('title', $sitename);
    $languages = 'homepage';
    $contact = true;
    $banner = build('banner', $lang, compact('languages', 'contact'));
    $languages = false;
    $contact = false;
    $footer = build('footer', $lang, compact('languages', 'contact'));
    $output = layout('standard', compact('sharebar', 'banner', 'footer', 'content'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:34,代码来源:homepage.php

示例5: index

 public function index()
 {
     layout(false);
     dump($ret);
     die;
     $this->display();
 }
开发者ID:kuanglitang,项目名称:kuanglitang,代码行数:7,代码来源:IndexController.class.php

示例6: configure

function configure()
{
    option('views_dir', '../app/views');
    option('controllers_dir', '../app/controllers');
    option('encoding', 'utf-8');
    layout('layouts/default.html.php');
}
开发者ID:jbgh2,项目名称:limonade-scaffold,代码行数:7,代码来源:environment.php

示例7: threadall

function threadall($lang)
{
    global $system_languages, $with_toolbar;
    if (!user_has_role('writer')) {
        return run('error/unauthorized', $lang);
    }
    $slang = false;
    if (isset($_GET['slang'])) {
        $slang = $_GET['slang'];
    } else {
        $slang = $lang;
    }
    if (!in_array($slang, $system_languages)) {
        return run('error/notfound', $lang);
    }
    $site_title = translate('title', $lang);
    $site_abstract = translate('description', $lang);
    $site_cloud = translate('keywords', $lang);
    head('title', translate('threadall:title', $slang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $edit = user_has_role('writer') ? url('threadedit', $_SESSION['user']['locale']) . '?' . 'clang=' . $lang : false;
    $banner = build('banner', $lang, $with_toolbar ? false : compact('edit'));
    $scroll = true;
    $toolbar = $with_toolbar ? build('toolbar', $lang, compact('edit', 'scroll')) : false;
    $threadlist = build('threadlist', $lang, false, false, $slang);
    $content = view('threadall', $slang, compact('site_title', 'site_abstract', 'site_cloud', 'threadlist'));
    $output = layout('viewing', compact('toolbar', 'banner', 'content'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:31,代码来源:threadall.php

示例8: ajax_display

 public function ajax_display($view)
 {
     layout(false);
     $this->html = $this->fetch($view);
     // sleep(5);
     $this->display();
 }
开发者ID:jksbill,项目名称:vadmin,代码行数:7,代码来源:BaseController.class.php

示例9: jump

 public function jump()
 {
     layout(false);
     $gid = I('id');
     $from = I('from');
     $model = M('goods');
     $find = $model->field('gurl')->where('gid=' . $gid)->find();
     empty($from) ? $from = 'pc' : ($from = 'app');
     if (empty($find)) {
         $this->redirect('/Index');
     }
     $c_model = M('userclick');
     $c_find = $c_model->field('uid')->where('gid=' . $gid)->find();
     if (empty($c_find)) {
         $data = array('gid' => $gid, 'count' => 1, 'ip' => get_client_ip(), 'from' => $from, 'endtime' => date('Y-m-d H:i:s'));
         $c_model->add($data);
     } else {
         $c_model->where('gid=' . $gid)->setInc('count', 1);
     }
     $pos = strpos($find['gurl'], "=");
     $pos++;
     $pid = substr($find['gurl'], $pos);
     $this->assign('pid', $pid);
     $this->assign('gurl', $find['gurl']);
     $this->display();
 }
开发者ID:hehuping,项目名称:Yiyazhe,代码行数:26,代码来源:JumpController.class.php

示例10: index

 public function index()
 {
     if (site()->users()->count() > 0) {
         go(panel()->urls()->login());
     }
     if ($problems = installation::check()) {
         $content = view('installation/check', array('problems' => $problems));
     } else {
         $form = panel()->form('installation', array('language' => kirby()->option('panel.language', 'en')));
         $form->cancel = false;
         $form->save = l('installation.signup.button');
         $form->centered = true;
         foreach (panel()->languages() as $lang) {
             $form->fields()->get('language')->options[$lang->code()] = $lang->title();
         }
         $form->on('submit', function ($form) {
             try {
                 // fetch all the form data
                 $data = $form->serialize();
                 // make sure that the first user is an admin
                 $data['role'] = 'admin';
                 // try to create the new user
                 $user = panel()->site()->users()->create($data);
                 // store the new username for the login screen
                 s::set('username', $user->username());
                 // redirect to the login
                 go(panel()->urls()->login() . '/welcome');
             } catch (Exception $e) {
                 $form->alert($e->getMessage());
             }
         });
         $content = view('installation/signup', array('form' => $form));
     }
     return layout('installation', array('meta' => new Snippet('meta'), 'content' => $content));
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:35,代码来源:installation.php

示例11: login

 /**
  * 后台用户登陆
  */
 public function login($username = null, $password = null, $verify = null)
 {
     if (IS_POST) {
         if (!check_verify($verify)) {
             $this->error('3验证码输入错误!');
         }
         $db = M('admin');
         $data['username'] = $username;
         $admin = $db->where($data)->find();
         if (!$admin) {
             $this->error('1帐号不存在或被禁用');
         }
         if ($admin['password'] != md5($password)) {
             $this->error('2密码不正确');
         }
         $data = array('uid' => $admin['uid'], 'login' => array('exp', '`login` + 1'), 'login_time' => date('y-m-d-H-i-s'), 'login_ip' => get_client_ip());
         $db->save($data);
         $auth = array('uid' => $data['uid'], 'login_time' => $data['login_time'], 'role' => $admin['role'], 'email' => $admin['email'], 'username' => $username);
         session('admin', $auth);
         session('_uid', $data['uid']);
         session('username', $username);
         //			echo dump(session('admin'));
         $this->success('登陆成功', U('Index/index', '', ''));
     } else {
         if (a_is_login()) {
             $this->redirect("Index/index");
         } else {
             layout(false);
             $this->display();
         }
     }
 }
开发者ID:Jitlee,项目名称:YYG,代码行数:35,代码来源:PublicController.class.php

示例12: index

 public function index()
 {
     layout(false);
     //登陆页面不需要应用模板
     $this->display('login');
     //        $this->success('新增成功', './Home/Customer/index',5);
 }
开发者ID:torrz,项目名称:gm_solor,代码行数:7,代码来源:IndexController.class.php

示例13: user

function user($lang, $arglist = false)
{
    global $login_verified, $base_url;
    $login = build('login', $lang);
    if ($login === true) {
        $r = !empty($arglist['r']) ? $arglist['r'] : false;
        if ($login_verified and array_intersect($login_verified, user_profile('role'))) {
            $user = $_SESSION['user'];
            unset($_SESSION['user']);
            if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
                return run('error/unauthorized', $lang);
            }
            $_SESSION['unverified_user'] = $user;
            $next_page = url('sslverifyclient');
            if ($r) {
                $next_page .= '?r=' . $r;
            }
        } else {
            $next_page = $r ? $r : url('home', $lang);
        }
        return reload($base_url . $next_page);
    }
    $banner = build('banner', $lang);
    $content = view('user', $lang, compact('login'));
    head('title', translate('user:title', $lang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $output = layout('standard', compact('banner', 'content'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:31,代码来源:user.php

示例14: r

 public function r($gid, $qishu, $pageNo = 1)
 {
     $mdb = M('MiaoshaRecord');
     $pageSize = 14;
     $filter = array('r.prize_gid' => $gid, 'r.prize_qishu' => $qishu);
     $list = $mdb->field("r.gid,r.qishu,r.mid,ms.time,ms.count,ms.ms,m.title\n\t\t\t,(HOUR(ms.time)*10000000+MINUTE(ms.time)*100000+SECOND(ms.time)*1000+ms) prizeno\n\t\t\t,INSERT(u.username,ROUND(CHAR_LENGTH(u.username) / 2),ROUND(CHAR_LENGTH(u.username) / 4),'****') username, u.img userimg")->join("r inner join __MEMBER_MIAOSHA__ ms on ms.id = r.mid")->join("inner join __MIAOSHA__ m on ms.gid = m.gid")->join("inner join __MEMBER__ u on u.uid = ms.uid")->where($filter)->order('ms.time desc')->page($pageNo, $pageSize)->select();
     $num = 0;
     $db = M('MiaoshaHistory');
     $data = $db->where(array('gid' => $gid, 'qishu' => $qishu))->field("end_time")->find();
     $this->assign('end_time', $data['end_time']);
     //		echo $mdb->getLastSql();
     $total = 0;
     if ($list) {
         $this->assign('list', $list);
         $num = count($list);
         $total = $mdb->where(array('prize_gid' => $gid, 'prize_qishu' => $qishu))->count();
         $pageCount = ceil($total / $pageSize);
         $this->assign('pageSize', $pageSize);
         $this->assign('pageNo', $pageNo);
         $this->assign('pageCount', $pageCount);
         $this->assign('minPageNo', floor(($pageNo - 1) / 10.0) * 10 + 1);
         $this->assign('maxPageNo', min(ceil($pageNo / 10.0) * 10 + 1, $pageCount));
     }
     $this->assign('gid', $gid);
     $this->assign('qishu', $qishu);
     $this->assign('num', $num);
     $this->assign('total', $total);
     layout(false);
     $this->display('record');
 }
开发者ID:Jitlee,项目名称:YYG,代码行数:30,代码来源:LotteryController.class.php

示例15: edit

 public function edit($id = 0)
 {
     $Data = M('Data');
     $this->assign('vo', $Data->find($id));
     layout(true);
     $this->display();
 }
开发者ID:heamon7,项目名称:mytodos,代码行数:7,代码来源:IndexController.class.php


注:本文中的layout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。