本文整理汇总了PHP中zbase_url_from_route函数的典型用法代码示例。如果您正苦于以下问题:PHP zbase_url_from_route函数的具体用法?PHP zbase_url_from_route怎么用?PHP zbase_url_from_route使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zbase_url_from_route函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBackendLoginPage
/**
* @group Urls
* @group Auth
*/
function testBackendLoginPage()
{
/**
* Test that guest cannot access member area or authed areas
* Test redirected to login page
*/
$this->visit(zbase_url_from_route('admin'))->seePageIs(zbase_url_from_route('admin.login'));
$this->assertEquals(302, $this->call('GET', zbase_url_from_route('admin'))->status());
}
示例2: function
<?php
/**
* Dx
*
* @link http://dennesabing.com
* @author Dennes B Abing <dennes.b.abing@gmail.com>
* @license proprietary
* @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
* @version 0.0.0.1
* @since Mar 8, 2016 10:37:59 AM
* @file widget.php
* @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
* @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
*
*/
return ['type' => 'form', 'enable' => function () {
return zbase_config_get('modules.account.widgets.notifications.enable', true);
}, 'config' => ['entity' => ['name' => 'user', 'method' => 'currentUser', 'repo' => ['method' => 'currentUser']], 'event' => ['email' => ['post' => ['redirect' => ['enable' => false]]]], 'form' => ['startTag' => ['action' => function () {
if (zbase_is_back()) {
return zbase_url_from_route('admin.account', ['action' => 'email']);
}
}, 'html' => ['attributes' => ['class' => ['zbase-ajax-form']]]]], 'elements' => ['email' => ['type' => 'email', 'id' => 'email', 'label' => 'Email Address', 'entity' => ['property' => 'email'], 'angular' => ['ngModel' => 'currentUser.email'], 'html' => ['attributes' => ['input' => ['autocomplete' => 'off']]], 'validations' => ['required' => ['enable' => true, 'message' => 'Email address is required.'], 'unique' => ['enable' => true, 'text' => function () {
return 'unique:' . zbase_entity('user')->getTable() . ',email,' . zbase_auth_user()->id() . ',user_id';
}, 'message' => 'Email address already exists.'], 'not_in' => ['enable' => true, 'text' => function () {
return 'not_in:' . zbase_auth_user()->email;
}, 'message' => 'Please provide a different email address.']]]]]];
示例3: zbase_url_from_route
echo zbase_url_from_route('account');
?>
">
<i class="fa fa-user"></i> My Profile
</a>
</li>
<li class="divider">
</li>
<li>
<a href="javascript:;" id="trigger_fullscreen">
<i class="fa fa-arrows"></i> Full Screen
</a>
</li>
<li>
<a href="<?php
echo zbase_url_from_route('logout');
?>
">
<i class="fa fa-key"></i> Log Out
</a>
</li>
</ul>
</li>
<?php
}
?>
<!-- END USER LOGIN DROPDOWN -->
</ul>
<!-- END TOP NAVIGATION MENU -->
</div>
<!-- END TOP NAVIGATION BAR -->
示例4: zbase_api_url
/**
* 'url' => '/api/{username}/{key}/{format}/{module}/{object}/{method}/{paramOne?}/{paramTwo?}/{paramThree?}/{paramFour?}/{paramFive?}/{paramSix?}',
* Create an API URL
* @param array $params
* @return string
*/
function zbase_api_url($params)
{
$array = [];
$array['username'] = !empty($params['username']) ? $params['username'] : 'username';
$array['key'] = !empty($params['key']) ? $params['key'] : 'key';
$array['format'] = !empty($params['format']) ? $params['format'] : 'json';
$array['module'] = !empty($params['module']) ? $params['module'] : null;
$array['object'] = !empty($params['object']) ? $params['object'] : null;
$array['method'] = !empty($params['method']) ? $params['method'] : null;
$array['paramOne'] = !empty($params['paramOne']) ? $params['paramOne'] : null;
$array['paramTwo'] = !empty($params['paramTwo']) ? $params['paramTwo'] : null;
$array['paramThree'] = !empty($params['paramThree']) ? $params['paramThree'] : null;
$array['paramFour'] = !empty($params['paramFour']) ? $params['paramFour'] : null;
$array['paramFive'] = !empty($params['paramFive']) ? $params['paramFive'] : null;
$array['paramSix'] = !empty($params['paramSix']) ? $params['paramSix'] : null;
return zbase_url_from_route('api', $array);
}
示例5: zbase_url_from_route
</head>
<body ui-prevent-touchmove-defaults>
<?php
if (zbase_auth_has()) {
?>
<!-- Sidebars -->
<div ng-include="'<?php
echo zbase_url_from_route('admin-angular-mobile-sidebar');
?>
?at=1'"
ui-track-as-search-param='true'
class="sidebar sidebar-left"></div>
<div ng-include="'<?php
echo zbase_url_from_route('admin-angular-mobile-sidebar-right');
?>
?at=1'"
class="sidebar sidebar-right"></div>
<div class="app"
ui-swipe-right='Ui.turnOn("uiSidebarLeft")'
ui-swipe-left='Ui.turnOff("uiSidebarLeft")'>
<!-- Navbars -->
<div class="navbar navbar-app navbar-absolute-top">
<div class="navbar-brand navbar-brand-center" ui-yield-to="title">
<% viewTitle %>
</div>
<div class="btn-group pull-left">
<div ui-toggle="uiSidebarLeft" class="btn sidebar-toggle">
示例6: zbase_view_render
* $code = The Code
*
* /account/email/verify?e=email&c=$code
* zbase_url_from_route('account', ['action' => 'email','task' => 'verify','e' => $newEmailAddress,'c' => $code])
*/
?>
<?php
echo zbase_view_render(zbase_view_file_contents('email.header'));
?>
<h1>Email Address verification</h1>
<p>To be able to continue, we need to verify your email address
<br />
Email Address: <?php
echo $newEmailAddress;
?>
Code: <strong><?php
echo $code;
?>
</strong>
<br />
<br />
<a href="<?php
echo zbase_url_from_route('account', ['action' => 'email', 'task' => 'verify', 'e' => $newEmailAddress, 'c' => $code]);
?>
">Click here</a> to verify your email address.
</p>
<?php
echo zbase_view_render(zbase_view_file_contents('email.footer'));
示例7: imageUrl
/**
* Return the image url
*
* @return string
*/
public function imageUrl($options = [])
{
$fullImage = false;
$params = ['node' => static::$nodeNamePrefix];
if ($this->singleImage) {
$params['id'] = $this->alphaId();
} else {
$params['id'] = $this->imageId();
}
if (empty($options) || !empty($options['full'])) {
$fullImage = true;
}
$params['w'] = !empty($options['w']) ? $options['w'] : 150;
$params['h'] = !empty($options['h']) ? $options['h'] : 0;
$params['q'] = !empty($options['q']) ? $options['q'] : 80;
if (!empty($options['thumbnail'])) {
$params['w'] = !empty($options['w']) ? $options['w'] : 200;
$params['h'] = !empty($options['h']) ? $options['h'] : 0;
$params['q'] = !empty($options['q']) ? $options['q'] : 80;
}
$params['ext'] = zbase_config_get('node.files.image.format', 'png');
return zbase_url_from_route('nodeImage', $params);
}
示例8: zbase_url_from_route
<?php
/**
* Dx
*
* @link http://dennesabing.com
* @author Dennes B Abing <dennes.b.abing@gmail.com>
* @license proprietary
* @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
* @version 0.0.0.1
* @since Apr 1, 2016 10:21:39 PM
* @file msgbutton.blade.php
* @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
* @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
*/
?>
<!--<div class="alert alert-danger">Are you sure you want to delete?</div>-->
<div class="btn-group" role="group" aria-label="Message buttons">
<button type="button" class="btn btn-danger btn-sm zbase-btn-action-confirm"
data-config="{url: '<?php
echo zbase_url_from_route('messages', array('action' => 'trash', 'id' => $msg->alphaId()));
?>
',
mode: 'yesno',
message: 'Are you sure you want to delete this message?',
}">Delete</button>
</div>
示例9: postFileUrl
/**
* Url to a file
*
* @return string
*/
public function postFileUrl($file = null, $action = 'view', $options = [])
{
if (method_exists($this, 'fileUrl')) {
return $this->fileUrl($file, $action, $options);
}
$task = null;
if (is_object($file) && !empty($file->name)) {
$task = $file->name;
}
if (is_object($file) && !empty($file->filename)) {
$task = $file->filename;
}
if (is_string($file)) {
$task = $file;
}
$action = str_replace('file-', '', $action);
if ($action != 'delete') {
// if(!empty($options['thumbnail']))
// {
// $width = 100;
// $height = 100;
// $task = '100x100_' . $task;
// }
// $width = !empty($options['w']) ? $options['w'] : (!empty($width) ? $width : null);
// $height = !empty($options['h']) ? $options['h'] : (!empty($height) ? $height : null);
}
if (zbase_auth_user()->isAdmin()) {
return zbase_url_from_route('admin.file', ['table' => $this->postTableName(), 'action' => $action, 'id' => $this->postId(), 'file' => $task]);
} else {
return zbase_url_from_route('file', ['table' => $this->postTableName(), 'action' => $action, 'id' => $this->postId(), 'file' => $task]);
}
}
示例10: actionUrl
/**
* Return this URL for Action
*/
public function actionUrl($action, $task = null)
{
$params = ['action' => $action, 'task' => $task];
$params['id'] = $this->alphaId();
if (zbase_is_back()) {
return zbase_url_from_route('admin.' . $this->actionUrlRouteName(), $params);
}
return zbase_url_from_route($this->actionUrlRouteName(), $params);
}
示例11: zbase_view_render_body
/**
* Render HTML before </body>
*
* @return string
*/
function zbase_view_render_body()
{
$str = '';
zbase()->view()->prepare();
$onloadScripts = zbase_view_placeholder_render('body_scripts_onload');
$str .= zbase_view_placeholder_render('body_javascripts');
$str .= zbase_view_placeholder_render('body_footer_html');
$str .= EOF . '<script type="text/javascript">';
$str .= EOF . zbase_view_compile(zbase_view_placeholder_render('body_scripts'));
if (!empty(zbase_auth_is_duplex())) {
$onloadScripts .= 'jQuery(\'body\').append(\'<div style="margin:0px auto;z-index:999999;background:yellow;width: auto;position:absolute;top:0px;padding:5px;margin-top:2px;margin-left:2px;">You are loggedin as: ' . zbase_auth_user()->displayFullDetails() . ' <a class="btn btn-danger btn-sm" href="' . zbase_url_from_route('admin.duplex', ['action' => 'unduplex']) . '">SignOut</a></div>\');';
}
if (!empty($onloadScripts)) {
$str .= EOF . 'jQuery(document).ready(function(){' . EOF . $onloadScripts . EOF . '});';
}
$str .= EOF . '</script>';
return $str;
}
示例12: zbase_url_from_route
if (zbase()->system()->inMaintenance()) {
?>
<div class="alert alert-danger text-center">
<a href="<?php
echo zbase_url_from_route('admin.system', ['action' => 'maintenance-mode-off']);
?>
" class="btn btn-danger">Stop Maintenance Mode</a>
<br />
<br />
Website is currently in <strong>maintenance mode</strong>.
</div>
<?php
} else {
?>
<div class="alert alert-info text-center">
<a href="<?php
echo zbase_url_from_route('admin.system', ['action' => 'maintenance-mode-on']);
?>
" class="btn btn-info">Set to Maintenance Mode</a>
<br />
<br />
When <strong>maintenance mode</strong> is enabled,<br />
a maintenance message will be displayed when someone accesses the site.
Your current IP Address of <strong><?php
echo zbase_ip();
?>
</strong> will be excluded.
</div>
<?php
}
示例13: src
/**
* The Image
*/
public function src()
{
return zbase_url_from_route('siteImageWatermark', ['f' => $this->filename]);
}
示例14: zbase_url_from_route
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar navbar-collapse collapse">
<!-- BEGIN SIDEBAR MENU -->
<ul class="page-sidebar-menu" data-auto-scroll="true" data-slide-speed="200">
<li class="sidebar-toggler-wrapper">
<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
<div class="sidebar-toggler hidden-phone">
</div>
<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
</li>
<li class="start ">
<a href="<?php
echo zbase_url_from_route('admin');
?>
">
<i class="fa fa-home"></i>
<span class="title">
Dashboard
</span>
</a>
</li>
<?php
$modules = zbase()->modules();
$navs = [];
foreach ($modules as $module) {
if ($module->hasNavigation(zbase_section())) {
$navs[] = $module;
}
}
$navs = zbase_collection($navs)->sortByDesc(function ($itm) {
return $itm->getNavigationOrder();
示例15: updateRequestEmailAddress
/**
* First step in updating email address.
* - Code will be sent to the old email address with a verification code
* @param string $newEmailAddress
* @return boolean
*/
public function updateRequestEmailAddress($newEmailAddress)
{
if (!empty($newEmailAddress) && $this->email() != $newEmailAddress) {
zbase_db_transaction_start();
try {
/**
* Admin is changing the email Address
*/
if (zbase_auth_user()->id() != $this->id() && zbase_auth_user()->isAdmin()) {
/**
* Send a request code to the old email address
* option: email_verification_code: code; new_email: $newEmail Address
*/
$oldEmail = $this->email();
$this->email = $newEmailAddress;
$this->email_verified = 0;
$this->save();
zbase_alert('info', _zt($this->displayFullDetails() . ' email address was updated to <strong>%email%</strong> from <strong>' . $oldEmail . '</strong>.', ['%email%' => $this->email()]));
$this->log('user::updateRequestEmailAddress', null, ['new_email' => $newEmailAddress, 'admin_id' => zbase_auth_user()->id()]);
} else {
/**
* Send a request code to the old email address
* option: email_verification_code: code; new_email: $newEmail Address
*/
$code = zbase_generate_code();
$this->setDataOption('email_updaterequest_code', $code);
$this->setDataOption('email_new', $newEmailAddress);
$this->setDataOption('email_new_request_date', zbase_date_now());
$this->save();
$url = zbase_url_from_route('update-email-request', ['email' => $this->email(), 'token' => $code]);
$urlText = null;
if (zbase_is_dev()) {
$urlText = '<a href="' . $url . '">' . $url . '</a>';
zbase()->json()->setVariable('updateRequestEmailAddress', $url);
}
zbase_alert('info', _zt('We sent an email to %email% with a link to complete the process of updating your email address.' . $urlText, ['%email%' => $this->email()]));
zbase_messenger_email($this->email(), 'account-noreply', _zt('New Email address update request'), zbase_view_file_contents('email.account.newEmailAddressRequest'), ['entity' => $this, 'newEmailAddress' => $newEmailAddress, 'code' => $code, 'url' => $url]);
$this->log('user::updateRequestEmailAddress', null, ['new_email' => $newEmailAddress]);
}
zbase_db_transaction_commit();
return true;
} catch (\Zbase\Exceptions\RuntimeException $e) {
zbase_db_transaction_rollback();
return false;
}
} else {
zbase_alert('info', _zt('We sent an email to %email% with a link to complete the process of updating your email address.', ['%email%' => $this->email()]));
}
}