本文整理汇总了PHP中URL::createLink方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::createLink方法的具体用法?PHP URL::createLink怎么用?PHP URL::createLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::createLink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changeStatus
public function changeStatus($arrayParam, $option = null)
{
if ($option['task'] == 'change-ajax-status') {
$status = $arrayParam['status'] == 0 ? 1 : 0;
$id = $arrayParam['id'];
$query = "UPDATE `{$this->table}` SET `status` = {$status} WHERE `id` = {$id}";
$this->query($query);
$result = array('id' => $id, 'status' => $status, 'link' => URL::createLink('admin', 'group', 'ajaxStatus', array('id' => $id, 'status' => $status)));
//array($id, $status, URL::createLink('admin', 'group', 'ajaxStatus', array('id' => $id, 'status' => $status)));
return $result;
}
if ($option['task'] == 'change-ajax-group-acp') {
$group_acp = $arrayParam['group_acp'] == 0 ? 1 : 0;
$id = $arrayParam['id'];
$query = "UPDATE `{$this->table}` SET `group_acp` = {$group_acp} WHERE `id` = {$id}";
$this->query($query);
$result = array('id' => $id, 'group_acp' => $group_acp, 'link' => URL::createLink('admin', 'group', 'ajaxGroupACP', array('id' => $id, 'group_acp' => $group_acp)));
// return array($id, $group_acp, URL::createLink('admin', 'group', 'ajaxGroupACP', array('id' => $id, 'group_acp' => $group_acp)));
return $result;
}
if ($option['task'] == 'change-status') {
$status = $arrayParam['type'];
if (!empty($arrayParam['cid'])) {
$ids = $this->createWhereDeleteSQL($arrayParam['cid']);
$query = "UPDATE `{$this->table}` SET `status` = {$status} WHERE `id` IN ({$ids})";
$this->query($query);
Session::set('message', array('class' => 'success', 'content' => $this->affectedRows() . ' updated successfully'));
} else {
Session::set('message', array('class' => 'error', 'content' => 'Please choose the item that you want to change status !!'));
}
}
}
示例2: changeStatus
public function changeStatus($arrayParam, $option = null)
{
if ($option['task'] == 'change-ajax-status') {
$status = $arrayParam['status'] == 0 ? 1 : 0;
$modified = date('Y-m-d', time());
$modified_by = $this->_userInfo['username'];
$id = $arrayParam['id'];
$query = "UPDATE `{$this->table}` SET `status` = {$status}, `modified` = '{$modified}', `modified_by` = '{$modified_by}' WHERE `id` = {$id}";
$this->query($query);
$result = array('id' => $id, 'status' => $status, 'link' => URL::createLink('admin', 'category', 'ajaxStatus', array('id' => $id, 'status' => $status)));
//array($id, $status, URL::createLink('admin', 'group', 'ajaxStatus', array('id' => $id, 'status' => $status)));
return $result;
}
if ($option['task'] == 'change-status') {
$status = $arrayParam['type'];
$modified = date('Y-m-d', time());
$modified_by = $this->_userInfo['username'];
if (!empty($arrayParam['cid'])) {
$ids = $this->createWhereDeleteSQL($arrayParam['cid']);
$query = "UPDATE `{$this->table}` SET `status` = {$status}, `modified` = '{$modified}', `modified_by` = '{$modified_by}' WHERE `id` IN ({$ids})";
$this->query($query);
Session::set('message', array('class' => 'success', 'content' => $this->affectedRows() . ' updated successfully'));
} else {
Session::set('message', array('class' => 'error', 'content' => 'Please choose the item that you want to change status !!'));
}
}
}
示例3: internalAction
public function internalAction()
{
$this->_view->_title = 'Internal Group Management';
if (isset($_GET['team']) && trim($_GET['team']) != '') {
if (isset($_POST['group_form']) && !empty($_POST['group_form'])) {
$this->_view->colUser = $this->_model->listTeamUser($_GET['team'], $_POST['group_form']);
} else {
if (!isset($_GET['date_from']) && !isset($_GET['date_to'])) {
$arrayDefault = array('date_from' => date("d/m/Y"), 'date_to' => date("d/m/Y"));
$this->_view->colUser = $this->_model->listTeamUser($_GET['team'], $arrayDefault);
$this->_view->duration = $this->_model->getDuration('2', $arrayDefault, 'standard_duration');
$this->_view->chart = $this->_model->createChart($_GET['team'], $arrayDefault);
} else {
if (isset($_GET['date_from']) && isset($_GET['date_to'])) {
$arrayDate = array('date_from' => $_GET['date_from'], 'date_to' => $_GET['date_to']);
$this->_view->colUser = $this->_model->listTeamUser($_GET['team'], $arrayDate);
$this->_view->duration = $this->_model->getDuration('2', $arrayDate, 'standard_duration');
$this->_view->chart = $this->_model->createChart($_GET['team'], $arrayDate);
} else {
$this->_view->colUser = $this->_model->listTeamUser($_GET['team']);
}
}
}
} else {
URL::redirect(URL::createLink('default', 'index', 'index'));
}
// CREATE CHART
if (isset($_POST['group_form'])) {
$this->_view->duration = $this->_model->getDuration('2', $_POST['group_form'], 'standard_duration');
$this->_view->chart = $this->_model->createChart($_GET['team'], $_POST['group_form']);
}
$this->_view->render('group/internal');
}
示例4: deleteAction
public function deleteAction()
{
$permission = isset($_SESSION['user']) && $_SESSION['user']['info']['admin_control'] == true ? true : false;
if ($permission == true) {
$this->_view->_title = 'Delete | User';
$this->_view->message = '';
if (isset($_GET['id'])) {
$this->_view->message = $this->_model->processDelete($_GET['id']);
}
$this->_view->render('user/delete', true);
} else {
URL::redirect(URL::createLink('default', 'error', 'index', array('type' => 'not-url')));
}
}
示例5: editAction
public function editAction()
{
$permission = isset($_SESSION['user']) && $_SESSION['user']['info']['admin_control'] == true ? true : false;
if ($permission == true) {
$this->_view->_title = 'Edit | Team';
if (isset($_GET['id'])) {
$this->_view->_arrayTeam = $this->_model->arrayEdit($_GET['id']);
}
if (isset($_POST['editTeam']) && isset($_GET['id'])) {
$this->_view->_result = $this->_model->processEdit($_POST['editTeam'], $_GET['id']);
URL::redirect(URL::createLink('default', 'team', 'edit', array('id' => $_GET['id'])));
}
$this->_view->render('team/edit', true);
} else {
URL::redirect(URL::createLink('default', 'error', 'index', array('type' => 'not-url')));
}
}
示例6: callMethod
private function callMethod()
{
$actionName = $this->_params['action'] . 'Action';
if (method_exists($this->_controllerObject, $actionName) == true) {
$module = $this->_params['module'];
$controller = $this->_params['controller'];
$action = $this->_params['action'];
$requestURL = $module . "-" . $controller . "-" . $action;
$userInfo = Session::get('user');
$logged = $userInfo['login'] == true && $userInfo['time'] + TIME_LOGIN >= time();
// MODULE ADMIN
if ($logged == true) {
$this->_controllerObject->{$actionName}();
} else {
$this->callLoginAction();
}
//$this->_controllerObject->$actionName();
} else {
//$this->_error();
URL::redirect(URL::createLink('default', 'error', 'index', array('type' => 'not-url')));
}
}
示例7: indexAction
public function indexAction()
{
$this->_view->_title = 'Personal Management';
$totalItems = $this->_model->countItem($this->_arrParam, null);
$configPagination = array('totalItemsPerPage' => 5, 'pageRange' => 2);
$this->setPagination($configPagination);
$this->_view->pagination = new Pagination($totalItems, $this->_pagination);
//$this->_view->Items = $this->_model->listItems($this->_arrParam, null);
// Process Maintenance Data
//$this->_view->arrayMaintenance = $this->_model->processMaintenance();
// Process Newton Data
//$this->_view->arrayNewtonDetail = $this->_model->processNewtonDetail();
//$this->_view->arrayNewton = $this->_model->processNewton();
// Process Newcoding Detail
//$this->_view->arrayNewCodingDetail = $this->_model->processNewCodingDetail();
//$this->_view->arrayNewCoding = $this->_model->processNewCoding();
// Process Domestic Data
//$this->_view->arrayDomestic = $this->_model->processDomestic();
// Process FC Data
//$this->_view->arrayFcDetail = $this->_model->processFcDetail();
//$this->_view->arrayFc = $this->_model->processFc();
// Process Other
//$this->_view->arrayOther = $this->_model->processOther();
// Process Research
//$this->_view->arrayResearch = $this->_model->processResearch();
// Process Worktime
//$this->_view->arrayWorktime = $this->_model->processWorkTime();
$this->_model->importMaintenance();
$this->_model->importNewton();
$this->_model->importDomestic();
$this->_model->importFC();
$this->_model->importOther();
$this->_model->importResearch();
$this->_model->importNewCoding();
$this->_model->importWorkTime();
URL::redirect(URL::createLink('default', 'index', 'index'));
$this->_view->render('import/index', true);
}
示例8:
<?php
$linkCategory = URL::createLink('admin', 'category', 'index');
$linkBook = URL::createLink('admin', 'user', 'index');
?>
<div id="submenu-box">
<div class="m">
<ul id="submenu">
<li><a href="<?php
echo $linkCategory;
?>
" class="active">Category</a></li>
<li><a href="<?php
echo $linkBook;
?>
">Book</a></li>
</ul>
<div class="clr"></div>
</div>
</div>
示例9: array
$linkOrdering = URL::createLink('admin', $controller, 'ordering', array('type' => 0));
$btnOrdering = Helper::cmsButton('Ordering', 'toolbar-checkin', $linkOrdering, 'icon-32-checkin', 'submit');
// Trash
$linkTrash = URL::createLink('admin', $controller, 'trash');
$btnTrash = Helper::cmsButton('Trash', 'toolbar-trash', $linkTrash, 'icon-32-trash', 'submit');
// Save
$linkSave = URL::createLink('admin', $controller, 'form', array('type' => 'save'));
$btnSave = Helper::cmsButton('Save', 'toolbar-apply', $linkSave, 'icon-32-apply', 'submit');
// Save & Close
$linkSaveClose = URL::createLink('admin', $controller, 'form', array('type' => 'save-close'));
$btnSaveClose = Helper::cmsButton('Save & Close', 'toolbar-save', $linkSaveClose, 'icon-32-save', 'submit');
// Save & New
$linkSaveNew = URL::createLink('admin', $controller, 'form', array('type' => 'save-new'));
$btnSaveNew = Helper::cmsButton('Save & New', 'toolbar-save-new', $linkSaveNew, 'icon-32-save-new', 'submit');
// Cancel
$linkCancel = URL::createLink('admin', $controller, 'index');
$btnCancel = Helper::cmsButton('Cancel', 'toolbar-cancel', $linkCancel, 'icon-32-cancel');
switch ($this->arrayParams['action']) {
case 'index':
if ($controller == 'group') {
$strButton = $btnPublish . $btnUnPublish . $btnOrdering;
} else {
$strButton = $btnNew . $btnPublish . $btnUnPublish . $btnOrdering . $btnTrash;
}
break;
case 'form':
$strButton = $btnSave . $btnSaveClose . $btnSaveNew . $btnCancel;
break;
case 'profile':
$strButton = $btnSave . $btnSaveClose . $btnCancel;
break;
示例10:
" />
</div>
<div class="form-group">
<label class="form-label" for="team_number">Team Number</label>
<input id="team_number" type="text" data-required="1" class="form-control" name="editTeam[team_number]" placeholder="Full Name" value="<?php
echo $teamNumber;
?>
" />
</div>
<button class="btn btn-success" type="submit"><i class="fa fa-check-square-o"></i> Submit</button>
<a href="<?php
echo URL::createLink('default', 'team', 'insert');
?>
&type=insert" class="btn btn-danger"><i class="fa fa-times"></i> Cancel</a>
<a href="<?php
echo URL::createLink('default', 'team', 'index');
?>
" class="btn btn-primary"><i class="fa fa-backward"></i> Go Back</a>
</fieldset>
</form>
</div>
</div>
</div>
</div>
<!-- END CONTAINER -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<?php
include_once MODULE_PATH . 'default/views/footer.php';
示例11: listGoogleLink
public function listGoogleLink()
{
$arraySource = $this->listProjectLink();
$arrayProject = $this->listProject();
$d = 1;
$xhtml = '';
for ($i = 0; $i < count($arraySource); $i++) {
$class = $d % 2 == 0 ? 'even' : 'odd';
foreach ($arrayProject as $key => $value) {
if ($arraySource[$i]['project_link'] == $value['id']) {
$arraySource[$i]['project_link'] = $value['project_type'];
}
}
$xhtml .= '<tr class="gradeA">';
$xhtml .= '<td class="text-center">' . $arraySource[$i]['id'] . '</td>
<td class="text-center">' . $arraySource[$i]['link'] . '</td>
<td class="text-center">' . $arraySource[$i]['link_month'] . '</td>
<td class="text-center">' . $arraySource[$i]['link_year'] . '</td>
<td class="text-center">' . $arraySource[$i]['project_link'] . '</td>
<td class="text-center"><a class="btn btn-mini btn-primary" href="' . URL::createLink('default', 'google', 'insert') . '&type=edit&idLink=' . $arraySource[$i]['id'] . '">Edit</a> <a class="btn btn-mini btn-danger" href="' . URL::createLink('default', 'google', 'delete') . '&idLink=' . $arraySource[$i]['id'] . '" onclick="return ConfirmDelete();">Delete</a></td>';
$xhtml .= '</tr>';
$d++;
}
return $xhtml;
}
示例12: array
$name = $value['name'];
$picturePath = UPLOAD_PATH . 'category' . DS . '60x90-' . $value['picture'];
if (file_exists($picturePath) == true) {
$picture = '<img src="' . UPLOAD_URL . 'category' . DS . '60x90-' . $value['picture'] . '" />';
} else {
$picture = '<img src="' . UPLOAD_URL . 'category' . DS . '60x90-default.jpg" />';
}
$row = $i % 2 == 0 ? 'row0' : 'row1';
// index.php?module=admin&controller=category&action=ajaxStatus&id=2&status=0
$status = Helper::cmsStatus($value['status'], URL::createLink('admin', 'category', 'ajaxStatus', array('id' => $id, 'status' => $value['status'])), $id);
$ordering = '<input type="text" name="order[' . $id . ']" size="5" value="' . $value['ordering'] . '" class="text-area-order">';
$created = Helper::formatDate('d-m-Y', $value['created']);
$created_by = $value['created_by'];
$modified = Helper::formatDate('d-m-Y', $value['modified']);
$modified_by = $value['modified_by'];
$linkEdit = URL::createLink('admin', 'category', 'form', array('id' => $id));
echo '<tr class="' . $row . '">
<td class="center">' . $ckb . '</td>
<td><a href="' . $linkEdit . '">' . $name . '</a></td>
<td class="center">' . $picture . '</td>
<td class="center">' . $status . '</td>
<td class="center">' . $ordering . '</td>
<td class="center">' . $created . '</td>
<td class="center">' . $created_by . '</td>
<td class="center">' . $modified . '</td>
<td class="center">' . $modified_by . '</td>
<td class="center">' . $id . '</td>
</tr>';
$i++;
}
}
示例13: foreach
if (!empty($this->Items)) {
$i = 0;
foreach ($this->Items as $key => $value) {
$id = $value['id'];
$ckb = '<input type="checkbox" name="cid[]" value="' . $id . '" />';
$name = $value['name'];
$row = $i % 2 == 0 ? 'row0' : 'row1';
// index.php?module=admin&controller=group&action=ajaxStatus&id=2&status=0
$status = Helper::cmsStatus($value['status'], URL::createLink('admin', 'group', 'ajaxStatus', array('id' => $id, 'status' => $value['status'])), $id);
$group_acp = Helper::cmsGroupACP($value['group_acp'], URL::createLink('admin', 'group', 'ajaxGroupACP', array('id' => $id, 'group_acp' => $value['group_acp'])), $id);
$ordering = '<input type="text" name="order[' . $id . ']" size="5" value="' . $value['ordering'] . '" class="text-area-order">';
$created = Helper::formatDate('d-m-Y', $value['created']);
$created_by = $value['created_by'];
$modified = Helper::formatDate('d-m-Y', $value['modified']);
$modified_by = $value['modified_by'];
$linkEdit = URL::createLink('admin', 'group', 'form', array('id' => $id));
echo '<tr class="' . $row . '">
<td class="center">' . $ckb . '</td>
<td><a href="' . $linkEdit . '">' . $name . '</a></td>
<td class="center">' . $status . '</td>
<td class="center">' . $group_acp . '</td>
<td class="center">' . $ordering . '</td>
<td class="center">' . $created . '</td>
<td class="center">' . $created_by . '</td>
<td class="center">' . $modified . '</td>
<td class="center">' . $modified_by . '</td>
<td class="center">' . $id . '</td>
</tr>';
$i++;
}
}
示例14: array
$linkOrdering = URL::createLink('admin', 'book', 'ordering', array('type' => 0));
$btnOrdering = Helper::cmsButton('Ordering', 'toolbar-checkin', $linkOrdering, 'icon-32-checkin', 'submit');
// Trash
$linkTrash = URL::createLink('admin', 'book', 'trash');
$btnTrash = Helper::cmsButton('Trash', 'toolbar-trash', $linkTrash, 'icon-32-trash', 'submit');
// Save
$linkSave = URL::createLink('admin', 'book', 'form', array('type' => 'save'));
$btnSave = Helper::cmsButton('Save', 'toolbar-apply', $linkSave, 'icon-32-apply', 'submit');
// Save & Close
$linkSaveClose = URL::createLink('admin', 'book', 'form', array('type' => 'save-close'));
$btnSaveClose = Helper::cmsButton('Save & Close', 'toolbar-save', $linkSaveClose, 'icon-32-save', 'submit');
// Save & New
$linkSaveNew = URL::createLink('admin', 'book', 'form', array('type' => 'save-new'));
$btnSaveNew = Helper::cmsButton('Save & New', 'toolbar-save-new', $linkSaveNew, 'icon-32-save-new', 'submit');
// Cancel
$linkCancel = URL::createLink('admin', 'book', 'index');
$btnCancel = Helper::cmsButton('Cancel', 'toolbar-cancel', $linkCancel, 'icon-32-cancel');
switch ($this->arrayParams['action']) {
case 'index':
$strButton = $btnNew . $btnPublish . $btnUnPublish . $btnOrdering . $btnTrash;
break;
case 'form':
$strButton = $btnSave . $btnSaveClose . $btnSaveNew . $btnCancel;
break;
}
?>
<div id="toolbar-box">
<div class="m">
<!-- TOOLBAR -->
<div class="toolbar-list" id="toolbar">
<ul>
示例15:
<!-- Start Page Header -->
<!-- End Page Header -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START CONTAINER -->
<div class="panel-body">
<div class="container-padding">
<!-- Start Row -->
<div class="row">
<!-- Start Panel -->
<div class="col-md-12">
<p class="text-right"><a href="<?php
echo URL::createLink('default', 'team', 'insert');
?>
" class="btn btn-success"><i class="fa fa-plus"></i> Insert</a></p>
<div class="panel panel-default">
<div class="panel-title"><?php
echo $this->_title;
?>
</div>
<div class="panel-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<td>ID</td>
<td>Team</td>
<td>Team Name</td>