本文整理汇总了PHP中purl函数的典型用法代码示例。如果您正苦于以下问题:PHP purl函数的具体用法?PHP purl怎么用?PHP purl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了purl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
if ($this->post('submit_order') && $this->post('form') == 'order') {
foreach ($_POST as $var => $value) {
if (strpos($var, 'order_') !== false) {
$id = (int) str_replace('order_', '', $var);
$this->link->update(array('listorder' => $value), 'id=' . $id);
}
}
}
if ($this->post('submit_del') && $this->post('form') == 'del') {
foreach ($_POST as $var => $value) {
if (strpos($var, 'del_') !== false) {
$id = (int) str_replace('del_', '', $var);
$this->link->delete('id=' . $id);
}
}
}
$page = (int) $this->get('page');
$page = !$page ? 1 : $page;
//分页配置
$pagelist = $this->instance('pagelist');
$pagelist->loadconfig();
$total = $this->link->count('link');
$pagesize = isset($this->site['SITE_ADMIN_PAGESIZE']) && $this->site['SITE_ADMIN_PAGESIZE'] ? $this->site['SITE_ADMIN_PAGESIZE'] : 8;
$url = purl('admin/index', array('page' => '{page}'));
$data = $this->link->page_limit($page, $pagesize)->order(array('listorder ASC', 'addtime DESC'))->select();
$pagelist = $pagelist->total($total)->url($url)->num($pagesize)->page($page)->output();
$this->assign(array('list' => $data, 'pagelist' => $pagelist));
$this->display('admin_list');
}
示例2: delete
public function delete($id = null)
{
$filename = get('filename');
$page = $this->page($id);
$file = $this->file($page, $filename);
$back = array('index' => purl('files/index/' . $page->id()), 'file' => purl($file, 'show'));
return view('files/delete', array('p' => $page, 'f' => $file, 'back' => a::get($back, get('to'))));
}
示例3: getDay
public function getDay($date)
{
$Date = str::split($date, '-');
// If day folder doesn't exists, create it
$this->field()->check_day($this->model(), $date);
// Go to day edit page
go(purl($this->model(), 'year-' . $Date[0] . '/day-' . $date . '/edit/'));
}
示例4: __construct
public function __construct(User $user)
{
parent::__construct($user);
if (!$this->exists()) {
$this->root = $this->user->avatarRoot('{safeExtension}');
$this->url = purl('assets/images/avatar.png');
}
}
示例5: index
public function index()
{
$site = site();
$blueprint = blueprint::find($site);
$fields = $blueprint->fields()->toArray();
$content = $site->content()->toArray();
return view('metatags/index', array('topbar' => new Snippet('pages/topbar', array('breadcrumb' => new Snippet('breadcrumb', array('items' => array(array('title' => l('metatags'), 'url' => purl('metatags/'))))), 'search' => purl('pages/search/'))), 'form' => new Form($fields, $content), 's' => $site));
}
示例6: avatar
public function avatar($username)
{
$user = $this->user($username);
$back = array('users' => purl('users'), 'user' => purl($user, 'edit'), 'dashboard' => purl(''));
if (!site()->user()->isAdmin() and !$user->isCurrent()) {
goToErrorView('modal');
}
return view('users/avatar', array('user' => $user, 'uploadable' => is_writable(kirby()->roots()->avatars()), 'back' => a::get($back, get('to'))));
}
示例7: topbar
public function topbar($topbar)
{
$page = $this->page();
if ($page->isSite()) {
$topbar->append(purl('options'), l('metatags'));
}
$page->topbar($topbar);
$topbar->append($page->url('files'), l('files'));
}
示例8: index
public function index()
{
$site = site();
$blueprint = blueprint::find($site);
$fields = $blueprint->fields($site)->toArray();
$content = $site->content()->toArray();
$files = null;
// create the files
if ($blueprint->files()->max() !== 0 and $blueprint->files()->hide() == false) {
$files = new Snippet('pages/sidebar/files', array('page' => $site, 'files' => api::files($site, $blueprint)));
}
return view('metatags/index', array('topbar' => new Snippet('pages/topbar', array('breadcrumb' => new Snippet('breadcrumb', array('items' => array(array('title' => l('metatags'), 'url' => purl('metatags/'))))), 'search' => purl('pages/search/'))), 'form' => new Form($fields, $content), 's' => $site, 'files' => $files, 'license' => panel()->license()));
}
示例9: index
public function index()
{
$widgets = array();
$wroot = c::get('root.site') . DS . 'widgets';
$wdirs = dir::read($wroot);
foreach ($wdirs as $dir) {
$file = $wroot . DS . $dir . DS . $dir . '.php';
if (file_exists($file)) {
$widgets[$dir] = (require $file);
}
}
return view('dashboard/index', array('topbar' => new Snippet('pages/topbar', array('breadcrumb' => new Snippet('breadcrumb'), 'search' => purl('pages/search/'))), 'history' => history::get(), 'site' => site(), 'widgets' => $widgets, 'user' => site()->user()));
}
示例10: index
public function index()
{
$site = site();
$widgets = array();
$wroot = kirby()->roots()->widgets();
$wdirs = dir::read($wroot);
// fetch all top-level pages in the right order
$blueprint = blueprint::find($site);
$pages = api::subpages($site->children(), $blueprint);
foreach ($wdirs as $dir) {
$file = $wroot . DS . $dir . DS . $dir . '.php';
if (file_exists($file)) {
$widgets[$dir] = (require $file);
}
}
return view('dashboard/index', array('topbar' => new Snippet('pages/topbar', array('breadcrumb' => new Snippet('breadcrumb'), 'search' => purl('pages/search/'))), 'history' => history::get(), 'site' => $site, 'pages' => $pages, 'addbutton' => !api::maxPages($site, $blueprint->pages()->max()), 'widgets' => $widgets, 'user' => site()->user(), 'license' => panel()->license()));
}
示例11: index
public function index($id = null)
{
$page = $this->page($id);
$blueprint = blueprint::find($page);
$visible = api::subpages($page->children()->visible(), $blueprint);
$invisible = api::subpages($page->children()->invisible(), $blueprint);
$baseUrl = rtrim(purl('subpages/index/' . $page->id()), '/');
// don't create the view if the page is not allowed to have subpages
if ($blueprint->pages()->max() === 0) {
goToErrorView();
}
if ($limit = $blueprint->pages()->limit()) {
$visible = $visible->paginate($limit, array('page' => get('visible')));
$invisible = $invisible->paginate($limit, array('page' => get('invisible')));
$visiblePagination = new Snippet('subpages/pagination', array('pagination' => $visible->pagination(), 'nextUrl' => $baseUrl . '/visible:' . $visible->pagination()->nextPage() . '/invisible:' . $invisible->pagination()->page(), 'prevUrl' => $baseUrl . '/visible:' . $visible->pagination()->prevPage() . '/invisible:' . $invisible->pagination()->page()));
$invisiblePagination = new Snippet('subpages/pagination', array('pagination' => $invisible->pagination(), 'nextUrl' => $baseUrl . '/visible:' . $visible->pagination()->page() . '/invisible:' . $invisible->pagination()->nextPage(), 'prevUrl' => $baseUrl . '/visible:' . $visible->pagination()->page() . '/invisible:' . $invisible->pagination()->prevPage()));
}
return view('subpages/index', array('page' => $page, 'topbar' => new Snippet('pages/topbar', array('menu' => new Snippet('menu'), 'breadcrumb' => new Snippet('pages/breadcrumb', array('page' => $page, 'items' => array(array('url' => purl('subpages/index/' . $id), 'title' => l('subpages'))))), 'search' => purl($page, 'search'))), 'baseurl' => $baseUrl, 'addbutton' => !api::maxPages($page, $blueprint->pages()->max()) and $page->hasChildren(), 'sortable' => $blueprint->pages()->sortable(), 'visible' => $visible, 'flip' => $blueprint->pages()->sort() == 'flip', 'visiblePagination' => $visiblePagination, 'invisible' => $invisible, 'invisiblePagination' => $invisiblePagination));
}
示例12: delete
public function delete($username)
{
$user = $this->user($username);
$self = $this;
if (!panel()->user()->isAdmin() and !$user->isCurrent()) {
return $this->modal('error', array('headline' => l('error'), 'text' => l('users.delete.error.rights'), 'back' => purl('users')));
} else {
$form = $user->form('delete', function ($form) use($user, $self) {
try {
$user->delete();
$self->notify(':)');
$self->redirect('users');
} catch (Exception $e) {
$form->alert($e->getMessage());
}
});
return $this->modal('users/delete', compact('form'));
}
}
示例13: search
public function search($id = '/')
{
$page = $this->page($id);
return view('pages/search', array('topbar' => new Snippet('pages/search/topbar', array('menu' => new Snippet('menu'), 'breadcrumb' => new Snippet('pages/breadcrumb', array('page' => $page)), 'close' => $page->isSite() ? purl('/') : purl($page, 'show'))), 'page' => $page));
}
示例14: _l
</div>
</div>
<?php
} else {
?>
<div class="instruction">
<div class="instruction-content">
<p class="instruction-text"><?php
_l('subpages.index.add.first.text');
?>
</p>
<a data-shortcut="+" class="btn btn-rounded" href="<?php
echo purl('subpages/add/' . $page->id());
?>
">
<?php
_l('subpages.index.add.first.button');
?>
</a>
</div>
</div>
<?php
}
?>
</div>
示例15: label
/**
* Generate label markup
*
* @since 1.0.0
*
* @return string
*/
public function label()
{
/* Action button */
$action = new Brick('a');
$action->addClass('file-add-button label-option');
$action->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('pages.show.files.add'));
$action->attr('href', purl($this->page(), 'upload'));
/* Label */
$label = parent::label();
$label->addClass('figure-label');
$label->append($action);
return $label;
}