本文整理汇总了PHP中Url::action方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::action方法的具体用法?PHP Url::action怎么用?PHP Url::action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::action方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printClassesInNamespace
function printClassesInNamespace($namespace)
{
$classes = Library::findClassesIn($namespace);
if (!empty($classes)) {
echo '<ul>';
foreach ($classes as $class) {
echo '<li>' . Html::anchor(Url::action('RecessToolsCodeController::classInfo', $namespace . $class), $class) . '</li>';
}
echo '</ul>';
}
}
示例2: authorize
public function authorize()
{
// Prevent the user from having access to protected content
foreach ($this->excludedRoutes as $excludedRoute) {
if (preg_match_all("/{$excludedRoute}/i", Router::getRoute()) > 0) {
return;
}
}
if (!Session::get("logged_in")) {
Redirect::path($this->signinRoute ? $this->signinRoute : Url::action('signin'));
}
}
示例3:
<?php
Part::input($action, 'string');
Part::input($display, 'string');
Part::input($selectedUrl, 'string');
if ($selectedUrl == $display) {
$liClass = ' class="highlight"';
} else {
$liClass = '';
}
echo '<li' . $liClass . '>' . Html::anchor(Url::action($action), $display) . '</li>';
示例4:
<ul>
<li><?php
echo Html::anchor(Url::action('IconHarvesterHomeController::index'), 'Home');
?>
</li>
<!--
Add your application's navigation links here.
-->
</ul>
示例5: foreach
<?php
Layout::extend('layouts/master');
$title = 'Home';
?>
<ul>
<?php
// This is a really slow way to generate navigation.
// You probably should not use this in a real app. Thx -Kris
Library::import('recess.lang.Inflector');
$app = $controller->application();
$controllers = $app->listControllers();
foreach ($controllers as $controllerClass) {
$title = Inflector::toEnglish(str_replace('Controller', '', $controllerClass));
?>
<li><?php
echo Html::anchor(Url::action($controllerClass . '::index'), $title);
?>
</li>
<?php
}
?>
</ul>
示例6:
<h1><?php
echo Html::anchor(Url::action('ThemeController::details', $theme->id), $theme->name);
?>
by <?php
echo $theme->artist;
?>
</h1>
<?php
if ($current_page != $total_pages) {
echo "<p>Processed page {$current_page} of {$total_pages}.</p>";
}
?>
<?php
echo Html::anchor(Url::action('ThemeController::index'), 'Back to list of themes');
?>
<ul class="icons">
<?php
foreach ($icons as $icon) {
$app = $icon->app();
$artist = $icon->artist();
$icon_name = $app ? $app->name : 'Unknown';
$artist_name = $artist ? $artist->name : 'Unknown';
$class = $app ? '' : 'unknown-app';
?>
<li><img class="<?php
echo $class;
?>
" src="<?php
示例7: Session
require 'server/classes/Url.class.php';
require 'server/classes/Session.class.php';
// cria uma nova sessão e instancia o controle de URL
$session = new Session(true);
$url = new Url();
?>
<!DOCTYPE html>
<html>
<head>
<?php
// procura o arquivo 'headHTML.php', se ele existir o inclui
$uri = requirePage('server/helpers/headHTML.php');
include_once $uri;
// procura o cabeçalho arquivo que é obtido pela URL, se ele existir & se
// já existir um usuáro logado, o inclui
$uri = 'public/pages/' . $url->controller() . '/head/' . $url->action() . '.php';
$uri = requirePage($uri, 'head/');
include_once $uri;
?>
</head>
<body>
<?php
// procura o arquivo de cabeçalho, se ele existir o inclui
$uri = requirePage('public/header.php');
include_once $uri;
// procura o corpo do arquivo que é obtido pela URL, se ele existir & se
// já existir um usuáro logado, o inclui
$uri = 'public/pages/' . $url->controller() . '/' . $url->action() . '.php';
$uri = requirePage($uri);
include_once $uri;
// procura o arquivo de rodapé, se ele existir o inclui
示例8:
<?php
Layout::extend('layouts/theme');
if (isset($theme->id)) {
$title = 'Edit Theme #' . $theme->id;
} else {
$title = 'Create New Theme';
}
$title = $title;
?>
<?php
Part::draw('theme/form', $_form, $title);
?>
<?php
echo Html::anchor(Url::action('ThemeController::index'), 'Theme List');
示例9: ksort
?>
<tr>
<td><?php
echo $method;
?>
</td>
<td><?php
echo $fullPath;
?>
</td>
<td><?php
echo Html::anchor(Url::action('RecessToolsCodeController::classInfo', $route->class), Library::getClassName($route->class));
?>
</td>
<td><?php
echo Html::anchor(Url::action('RecessToolsCodeController::classInfo', $route->class) . '#method_' . $route->function, $route->function);
?>
</td>
</tr>
<?php
}
}
if (!empty($staticPaths) || !empty($parametricPaths)) {
ksort($staticPaths);
ksort($parametricPaths);
foreach ($staticPaths as $path => $node) {
Part::draw('routes/rows', $node, $fullPath . '/' . $path, $omit);
}
foreach ($parametricPaths as $path => $node) {
Part::draw('routes/rows', $node, $fullPath . '/$' . $path, $omit);
}
示例10: action
public static function action($action, $variables = [])
{
header("Location: " . Url::action($action, $variables));
}
示例11: emailActivation
/**
* Email activation
* AccountController::emailActivation()
*
* @return
*/
public function emailActivation($activationCode)
{
$status = $this->userService->updateEmail($activationCode);
$url = Url::action('ProfileController@emailActivationResponse', $status);
return Redirect::to($url);
}
示例12:
<?php
Part::input($theme, 'Theme');
?>
<h1><?php
echo Html::anchor(Url::action('ThemeController::details', $theme->id), $theme->name);
?>
by <?php
echo $theme->artist;
?>
</h1>
<ul>
<?php
foreach ($icons as $icon) {
?>
<li><?php
echo $icon->src;
?>
</li>
<?php
}
?>
</ul>