本文整理匯總了PHP中url::build方法的典型用法代碼示例。如果您正苦於以下問題:PHP url::build方法的具體用法?PHP url::build怎麽用?PHP url::build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類url
的用法示例。
在下文中一共展示了url::build方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onInfo
public function onInfo()
{
$header['title'] = '控製中心';
page::header($header);
page::top();
page::navbar(array(array('id' => 'main', 'title' => '首頁', 'href' => url::build('zotop/index/main')), array('id' => 'info', 'title' => '係統信息', 'href' => url::build('zotop/index/info'))));
page::bottom();
page::footer();
}
示例2: onDefault
public function onDefault()
{
$tables = $this->db->table()->get(true);
$header['title'] = '數據庫管理';
page::header($header);
page::add('<div id="page" class="clearfix">');
page::add('<div id="side">');
block::header('數據庫基本信息');
table::header();
table::row(array('w60' => '數據庫名稱', '2' => '' . $this->db->config['database'] . ''));
table::row(array('w60' => '數據庫版本', '2' => '' . $this->db->version(true) . ''));
table::row(array('w60' => '數據庫大小', '2' => '<b>' . $this->db->size() . '</b> '));
table::row(array('w60' => '數據表個數', '2' => '<b>' . count($tables) . '</b> 個'));
table::footer();
block::footer();
page::add('</div>');
page::add('<div id="main">');
page::top();
page::navbar($this->navbar(), 'table');
//zotop::dump($tables);
form::header(array('class' => 'ajax'));
$column['select'] = '<input name="id" class="selectAll" type="checkbox"/>';
$column['name'] = '數據表名稱';
$column['size w60'] = '大小';
$column['Rows w60'] = '記錄數';
$column['Engine w60'] = '類型';
$column['Collation w100'] = '整理';
$column['manage view w60'] = '瀏覽';
$column['manage delete'] = '刪除';
table::header('list', $column);
foreach ($tables as $table) {
$size = $table['Data_length'] + $table['Index_length'];
$column = array();
$column['select'] = '<input name="id[]" class="select" type="checkbox"/>';
$column['name'] = '<b>' . $table['Name'] . '</b><h5>' . $table['Comment'] . '</h5>';
$column['size w60'] = (string) format::size($size);
$column['Rows w60'] = $table['Rows'];
$column['Engine w60'] = $table['Engine'];
$column['collation w100'] = $table['Collation'];
$column['manage view w60'] = '<a href="' . url::build('system/database/table/record') . '">瀏覽</a>';
$column['manage delete'] = '<a href="' . url::build('system/database/table/delete') . '" class="confirm">刪除</a>';
table::row($column);
}
table::footer();
page::add('<div style="height:200px;"></div>');
form::buttons(array('type' => 'select', 'style' => 'width:180px', 'options' => array('check' => '優化', 'delete' => '刪除')), array('type' => 'submit', 'value' => '執行操作'));
form::footer();
page::bottom();
page::add('</div>');
page::add('</div>');
page::footer();
}
示例3: latest_post
public static function latest_post()
{
$cache = kirby()->cache()->get('facebook.latest.post');
if (!is_null($cache)) {
return response::json($cache);
}
$response = remote::get(url::build(array('scheme' => static::$graph_scheme, 'host' => static::$graph_host, 'fragments' => array(c::get('facebook.id'), 'posts'), 'query' => array('access_token' => c::get('facebook.accesstoken'), 'limit' => 1))));
if ($response->content) {
// parse json string
$data = str::parse($response->content)['data'][0];
$return = array('text' => $data['message'], 'picture' => $data['picture'], 'timestamp' => strtotime($data['updated_time']), 'time_formatted' => strftime('%d. %B %G', strtotime($data['updated_time'])), 'link' => $data['link']);
// set cache for 10 minutes
kirby()->cache()->set('facebook.latest.post', $return, 10);
} else {
return false;
}
return $return;
}
示例4: onDefault
public function onDefault($status = -1)
{
$header['title'] = '短消息';
page::header($header);
page::top();
page::navbar(array(array('id' => 'main', 'title' => '短消息列表', 'href' => url::build('zotop/msg')), array('id' => 'send', 'title' => '發送短消息', 'href' => url::build('zotop/msg/send'), 'class' => 'dialog {width:600}')), 'main');
echo '<div style="padding:4px 15px;">';
echo '<table class="list">';
echo '<tr><td class="list-side">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
echo '<tr><td class="list-side">程序設計:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
echo '<tr><td class="list-side">程序開發:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
echo '<tr><td class="list-side">官方網站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
echo '<tr><td class="list-side">安裝時間:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
echo '</table>';
echo '</div>';
page::bottom();
page::footer();
}
示例5: onDefault
public function onDefault()
{
$header['title'] = '測試表單';
page::header($header);
page::top();
page::navbar(array(array('id' => 'form', 'title' => '測試表單', 'href' => url::build('system/test')), array('id' => 'info', 'title' => '係統信息', 'href' => url::build('system/index/info'))), 'form');
form::header(array('class' => 'ajax'));
block::header(array('title' => '基本信息', 'action' => 'more'));
form::add(array('type' => 'checkbox', 'label' => t('多選框'), 'name' => 'test1', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => array('1', '2'), 'description' => '最多隻允許選擇三項'));
form::add(array('type' => 'checkbox', 'label' => t('多選框'), 'name' => 'test11', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1'), 'value' => array('1', '2'), 'class' => 'block', 'description' => '最多隻允許選擇三項'));
form::add(array('type' => 'select', 'label' => '下拉列表', 'name' => 'test22', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => array('2', '4'), 'description' => '提示信息'));
form::add(array('type' => 'select', 'label' => '下拉列表', 'name' => 'test2', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => '2', 'description' => '提示信息'));
form::add(array('type' => 'text', 'label' => '文本框', 'name' => 'test3', 'value' => '2的飛灑的發生地', 'description' => '提示信息'));
block::footer();
block::header(array('title' => '高級信息', 'action' => 'more'));
form::add(array('type' => 'image', 'label' => '上傳圖片', 'name' => 'test4', 'value' => '2的飛灑的發生地', 'valid' => 'required:true', 'description' => '提示信息'));
form::add(array('type' => 'textarea', 'label' => '文本框', 'name' => 'test32', 'value' => '2的飛灑的發生地', 'valid' => 'required:true,maxlength:500', 'description' => '提示信息'));
form::add(array('label' => '組合', 'type' => 'group', 'fields' => array(array('label' => '年', 'name' => 'year', 'type' => 'text'), array('label' => '月', 'name' => 'month', 'type' => 'text'), array('label' => '日', 'name' => 'day', 'type' => 'text')), 'description' => '生成一個複合控件'));
block::footer();
form::buttons(array('type' => 'submit'), array('type' => 'reset'));
form::footer();
page::bottom();
page::footer();
}
示例6: redirect
public static function redirect($url, $time = 0)
{
$url = url::build($url);
header("Location: " . $url);
exit;
}
示例7: pageURL
/**
* Returns a page url for any given page number
*
* @param int $page The page number
* @return string The url
*/
public function pageURL($page)
{
if ($this->options['method'] == 'query') {
$query = url::query();
if ($page == 1) {
unset($query[$this->options['variable']]);
} else {
$query[$this->options['variable']] = $page;
}
return url::build(array('query' => $query));
} else {
$params = url::params();
if ($page == 1) {
unset($params[$this->options['variable']]);
} else {
$params[$this->options['variable']] = $page;
}
return url::build(array('params' => $params));
}
}
示例8: navbar
public function navbar()
{
return array(array('id' => 'default', 'title' => '係統角色列表', 'href' => url::build('zotop/role')), array('id' => 'add', 'title' => '添加角色', 'href' => url::build('zotop/role/add')), array('id' => 'edit', 'title' => '修改角色'));
}
示例9: navbar
public function navbar()
{
return array(array('id' => 'tables', 'title' => '數據庫管理', 'href' => url::build('system/database')));
}
示例10: redirect
public static function redirect($url, $params = null, $fragment = '')
{
$url = url::build($url);
header("Location: " . $url);
exit;
}
示例11: navbar
public function navbar()
{
return array(array('id' => 'main', 'title' => '基本設置', 'href' => url::build('zotop/index/main')), array('id' => 'info', 'title' => '係統信息', 'href' => url::build('zotop/index/info')));
}
示例12: navbar
public function navbar()
{
return array(array('id' => 'default', 'title' => '圖片庫', 'href' => url::build('zotop/upload/default')), array('id' => 'upload', 'title' => '本地上傳', 'href' => url::build('zotop/upload/image')), array('id' => 'bing', 'title' => 'Bing搜索', 'href' => url::build('zotop/upload/bing')));
}
示例13: navbar
public function navbar()
{
return array(array('id' => 'default', 'title' => '係統用戶列表', 'href' => url::build('zotop/user')), array('id' => 'add', 'title' => '添加係統用戶', 'href' => url::build('zotop/user/add')), array('id' => 'changepassword', 'title' => '修改密碼'), array('id' => 'changeinfo', 'title' => '修改資料'));
}
示例14: onDefault
public function onDefault($tablename)
{
$tables = zotop::db()->tables(true);
$table = $tables[$tablename];
$fields = array();
if (isset($table)) {
$fields = zotop::db()->table($tablename)->fields(true);
}
$indexes = zotop::db()->table($tablename)->index();
$page['title'] = '數據庫管理 <i>></i> 數據表 [ <b>' . $tablename . '</b> ] <h6>' . $table['comment'] . '</h6>';
page::header($page);
page::add('<div id="page" class="clearfix">');
page::add('<div id="main">');
page::add('<div id="main-inner">');
page::top();
page::navbar($this->navbar($tablename), 'fields');
form::header(array('class' => 'list'));
$column = array();
$column['select'] = html::checkbox(array('name' => 'id', 'class' => 'selectAll'));
//$column['key w30 center'] = '索引';
$column['name'] = '字段名稱';
$column['type w150'] = '字段類型';
//$column['null w50'] = '空值';
//$column['default w100'] = '默認值';
//$column['comment'] = '注釋';
$column['manage pri'] = '主鍵';
$column['manage index'] = '索引';
$column['manage unique'] = '唯一';
$column['manage fulltext'] = '全文';
$column['manage edit'] = '修改';
$column['manage delete'] = '刪除';
table::header('list', $column);
foreach ($fields as $field) {
$column = array();
$column['select'] = html::checkbox(array('name' => 'id[]', 'class' => 'select'));
//$column['key w30 center'] = '<span class="'.$field['key'].'">'.$field['key'].'</span>';
$column['name'] = '<a href="' . zotop::url('database/field/edit', array('table' => $tablename, 'field' => $field['name'])) . '" title="注釋:' . $field['comment'] . ' 默認:' . $field['default'] . ' 空值:' . $field['null'] . ' 整理:' . $field['collation'] . '"><b class="' . $field['key'] . '">' . $field['name'] . '</b></a><h5>' . $field['comment'] . '</h5>';
$column['type w150'] = $field['type'] . (empty($field['length']) ? '' : '(' . $field['length'] . ')');
//$column['null w50'] = $field['null'];
//$column['default w100'] = $field['default'];
//$column['comment'] = $field['comment'];
$column['manage pri'] = '<a href="' . zotop::url('database/field/primaryKey', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>確定要將該字段設置為主鍵?</h2>\'}">主鍵</a>';
$column['manage index'] = '<a href="' . zotop::url('database/field/index', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>確定要索引該字段?</h2>\'}">索引</a>';
$column['manage unique'] = '<a href="' . zotop::url('database/field/unique', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>確定要將該字段設置為唯一?</h2>\'}">唯一</a>';
if (stripos((string) $field['type'], 'varchar') !== false || stripos((string) $field['type'], 'text') !== false) {
$column['manage fulltext'] = '<a href="' . zotop::url('database/field/fulltext', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>確定要將該字段設置為全文索引?</h2>\'}">全文</a>';
} else {
$column['manage fulltext'] = '<a class="disabled">全文</a>';
}
$column['manage edit'] = '<a href="' . zotop::url('database/field/edit', array('table' => $tablename, 'field' => $field['name'])) . '">修改</a>';
$column['manage delete'] = '<a href="' . zotop::url('database/field/delete', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm">刪除</a>';
table::row($column, 'select');
}
table::footer();
form::buttons(array('type' => 'submit', 'value' => '瀏覽選中項'));
form::footer();
page::bottom();
page::add('</div>');
page::add('</div>');
page::add('<div id="side">');
block::header('數據表信息');
table::header();
table::row(array('w60 bold' => '名稱', '2' => '' . $table['name'] . ''));
table::row(array('w60 bold' => '大小', '2' => '' . format::byte($table['size']) . ''));
table::row(array('w60 bold' => '記錄數', '2' => '<b>' . $table['rows'] . '</b> '));
table::row(array('w60 bold' => '整理', '2' => '' . $table['collation'] . ''));
table::row(array('w60 bold' => '創建時間', '2' => '' . $table['createtime'] . ''));
table::row(array('w60 bold' => '更新時間', '2' => '' . $table['updatetime'] . ''));
//table::row(array('w60 bold'=>'注釋','2'=>''.$table['comment'].''));
table::footer();
block::footer();
block::header('索引信息');
$column = array();
$column['i w10'] = '';
$column['field'] = '字段';
$column['type w30'] = '類型';
$column['manage dropindex'] = '刪除';
table::header('list', $column);
foreach ($indexes as $index) {
$column = array();
$column['i w10 center'] = '>';
$column['field'] = '<b>' . $index['field'] . '</b>';
$column['type w30'] = $index['type'];
$column['manage dropindex'] = '<a href="' . url::build('database/field/dropindex', array('table' => $tablename, 'index' => $index['name'])) . '" class="confirm">刪除</a>';
table::row($column, 'select');
}
table::footer();
block::footer();
page::add('</div>');
page::add('</div>');
page::footer();
}
示例15: navbar
public function navbar()
{
$navbar = array('main' => array('title' => '首頁', 'href' => url::build('system/index/main')), 'phpinfo' => array('title' => 'phpinfo', 'href' => url::build('system/index/phpinfo')));
$navbar = zotop::filter('system.main.navbar', $navbar);
return $navbar;
}