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


PHP Lib::url方法代码示例

本文整理汇总了PHP中Lib::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Lib::url方法的具体用法?PHP Lib::url怎么用?PHP Lib::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lib的用法示例。


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

示例1: main

 public function main()
 {
     $key = Lib::hash(Config::$adminkey);
     $cookie = Lib::cookie();
     $identifier = $cookie->get($key);
     $admin = Lib::table('admin');
     $logged = !empty($identifier) && $admin->load(array('identifier' => $identifier));
     $type = Req::get('type');
     $ref = Req::get('ref');
     if (!empty($ref)) {
         if ($logged) {
             $segments = explode('/', base64_decode($ref));
             $base = array_shift($segments);
             $type = array_shift($segments);
             $subtype = array_shift($segments);
             $options = array();
             if (!empty($type)) {
                 $options['type'] = $type;
             }
             if (!empty($subtype)) {
                 $options['subtype'] = $subtype;
             }
             Lib::redirect($base, $options);
             return;
         }
         return $this->form();
     }
     if (!$logged) {
         if (empty($type)) {
             return $this->form();
         }
         $options = array('view' => 'admin');
         if (!empty($type)) {
             $options['type'] = $type;
         }
         $subtype = Req::get('subtype');
         if (!empty($subtype)) {
             $options['subtype'] = $subtype;
         }
         $ref = Lib::url('admin', $options);
         return Lib::redirect('admin', array('view' => 'admin', 'ref' => base64_encode($ref)));
     }
     if (empty($type)) {
         $type = 'index';
     }
     if (!is_callable(array($this, $type))) {
         return Lib::redirect('error');
     }
     return $this->{$type}();
 }
开发者ID:jasonrey,项目名称:project-test-report,代码行数:50,代码来源:admin.php

示例2: foreach

foreach (Lib::view('page')->getPages() as $pageslug => $page) {
    ?>
		<li class="menu-item"><a class="menu-item-link <?php 
    if ($viewname === 'page' && $pageslug === $slug) {
        ?>
active<?php 
    }
    ?>
" href="<?php 
    echo Lib::url('page', array('slug' => $pageslug));
    ?>
"><?php 
    echo $page->title;
    ?>
</a></li>
		<?php 
}
?>
		<li class="menu-item menu-item-about"><a class="menu-item-link <?php 
if ($viewname === 'about') {
    ?>
active<?php 
}
?>
" href="<?php 
echo Lib::url('about');
?>
">About</a></li>
	</ul>
</div>
开发者ID:jasonrey,项目名称:lab-page,代码行数:30,代码来源:menu.php

示例3: die

<?php

!defined('SERVER_EXEC') && die('No access.');
?>
<div id="<?php 
echo $pageslug;
?>
" class="post">
	<div class="container">
		<h3><a href="<?php 
echo Lib::url('page', array('slug' => $pageslug));
?>
"><?php 
echo $post->date;
?>
</a></h3>
		<h2><a href="<?php 
echo Lib::url('page', array('slug' => $pageslug));
?>
"><?php 
echo $post->title;
?>
</a></h2>
		<div class="content">
			<?php 
echo $pageview->loadTemplate($pageslug . '/content');
?>
		</div>
	</div>
</div>
开发者ID:jasonrey,项目名称:lab-page,代码行数:30,代码来源:post.php

示例4: redirect

 public static function redirect($target, $options = array(), $absolute = false)
 {
     $url = $absolute ? $target : Lib::url($target, $options, true);
     header('Location: ' . $url);
     die;
 }
开发者ID:jasonrey,项目名称:project-test-report,代码行数:6,代码来源:lib.php

示例5: die

<?php

!defined('SERVER_EXEC') && die('No access.');
?>
<div class="section section-login-form">
	<form class="login-form" role="form" method="post" action="<?php 
echo Lib::url('admin', array('type' => 'system', 'subtype' => 'login'));
?>
">
		<h2>Admin</h2>
		<div class="form-group">
			<label class="form-label" for="username">Username</label>
			<input class="form-input" type="text" name="username" />
		</div>

		<div class="form-group">
			<label class="form-label" for="username">Password</label>
			<input class="form-input" type="password" name="password" />
		</div>

		<input type="hidden" name="ref" value="<?php 
echo $ref;
?>
" />

		<div class="form-actions">
			<button class="form-button" type="submit">Login</button>
		</div>
	</form>
</div>
开发者ID:jasonrey,项目名称:project-test-report,代码行数:30,代码来源:form.php

示例6: getLink

 public function getLink()
 {
     return Lib::url('report', array('view' => 'report', 'id' => $this->id), true);
 }
开发者ID:jasonrey,项目名称:project-test-report,代码行数:4,代码来源:report.php

示例7: die

<?php

!defined('SERVER_EXEC') && die('No access.');
?>
<div class="page">
	<div class="section-login-form">
		<form class="login-form" role="form" method="post" action="<?php 
echo Lib::url('admin', array('view' => 'admin', 'type' => 'system', 'subtype' => 'create'));
?>
">
			<?php 
if (isset($errorMessage)) {
    ?>
			<div class="alert alert-danger">There was an error.</div>
			<?php 
}
?>

			<div class="alert alert-warning">There are no admins created yet.<br />Create one now.</div>

			<div class="form-group">
				<label class="form-label" for="username">Username</label>
				<input class="form-input" type="text" name="username" />
			</div>

			<div class="form-group">
				<label class="form-label" for="username">Password</label>
				<input class="form-input" type="password" name="password" />
			</div>

			<input type="hidden" name="ref" value="<?php 
开发者ID:jasonrey,项目名称:project-test-report,代码行数:31,代码来源:formcreate.php

示例8: die

<?php

!defined('SERVER_EXEC') && die('No access.');
if ($isLoggedIn) {
    ?>
<div id="report-frame">
	<a class="report-item-back icon-feather-rewind" href="<?php 
    echo Lib::url('index');
    ?>
">Back</a>
	<div class="report-project">
		<div class="project-name-title">Project</div>
		<div class="project-name"><?php 
    echo $project->name;
    ?>
</div>
	</div>
	<ul id="report-item-list">
		<?php 
    echo Lib::output('embed/report-item', array('report' => $report, 'user' => $user, 'assignees' => $assignees, 'commentsLoaded' => true));
    ?>
	</ul>
</div>
<?php 
    echo Lib::output('embed/screenshot-preview');
} else {
    echo Lib::output('embed/before-login');
}
?>

<script type="text/html" id="report-item-assignee">
开发者ID:jasonrey,项目名称:project-test-report,代码行数:31,代码来源:index.php

示例9: die

<?php

!defined('SERVER_EXEC') && die('No access.');
?>
<div class="new-project">
	<form class="new-project-content" method="post" action="<?php 
echo Lib::url('controller', array('controller' => 'project', 'action' => 'saveProjectTitle'));
?>
">
		<h1>Hi there.</h1>
		<p>Let's name this project:</p>

		<div class="form-group">
			<input type="text" class="form-input" name="project-title" placeholder="Project Name" />
		</div>

		<div class="form-actions">
			<button class="icon-feather-check">OK</button>
		</div>

		<input type="hidden" name="project-name" value="<?php 
echo $name;
?>
" />
	</form>
</div>
开发者ID:jasonrey,项目名称:project-test-report,代码行数:26,代码来源:new-project.php


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