當前位置: 首頁>>代碼示例>>PHP>>正文


PHP url::encode方法代碼示例

本文整理匯總了PHP中url::encode方法的典型用法代碼示例。如果您正苦於以下問題:PHP url::encode方法的具體用法?PHP url::encode怎麽用?PHP url::encode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在url的用法示例。


在下文中一共展示了url::encode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add

 /**
  * This will call the parentxontent controller to populate the view, while sending throught he type of content that it is 
  * as well as the paper_id, which will be used to autocomplete the paper combo box withg the correct result. 
  * @see Content_Controller::add()
  */
 public function add($paper_id = NULL)
 {
     $paper = orm::factory('paper', $paper_id);
     // load the paper so that we can get all the details required to populate the breadrumbs
     if ($paper->loaded) {
         $this->breadcrumbs->add()->url('products/papers/edit/' . url::encode($paper->name))->title(url::decode($paper->name));
         $this->breadcrumbs->add()->url('products/papers/technicals/index/' . $paper->id)->title('Technicals');
         $this->breadcrumbs->add()->url(false)->title('Add');
     }
     parent::add('technical', $paper->id);
 }
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:16,代碼來源:technicals.php

示例2: view

 /** 
  * This page will display a page much like the page for the paper products. 
  * 
  * the expcetion will be it will have multiple images and missing some of the relationships that 
  * the papers have.
  * 
  * 
  * @param unknown_type $name
  */
 public function view($name)
 {
     // clean the input, remove and opf the escape characters
     $name = url::encode($name);
     $industrial = orm::factory('industrial')->where('name', $name)->find_all();
     //if ($industrial->loaded)
     //{
     $view = new view(url::location());
     $view->industrial = $industrial[0];
     $this->template->title = ucwords($name);
     $this->template->content = $view;
     //}
     //else
     //{
     // unable to find the industrial item
     //}
 }
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:26,代碼來源:industrials.php

示例3: actionLicense

 public function actionLicense($path)
 {
     $module = zotop::model('zotop.module');
     $modules = $module->getUnInstalled();
     if (empty($path) || !dir::exists($path)) {
         msg::error(array('content' => zotop::t('模塊不存在,請確認是否已經上傳該模塊?'), 'description' => zotop::t("路徑:{$path}")));
     }
     $licenseFile = $path . DS . 'license.txt';
     if (!file::exists($licenseFile)) {
         zotop::redirect('zotop/module/install', array('path' => url::encode($path)));
         exit;
     }
     $license = file::read($licenseFile);
     $page = new dialog();
     $page->set('title', '許可協議');
     $page->set('license', html::decode($license));
     $page->set('next', zotop::url('zotop/module/install', array('path' => url::encode($path))));
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:19,代碼來源:module.php

示例4: actionUpload

 public function actionUpload($globalid, $field, $image = '')
 {
     $file = zotop::model('zotop.image');
     if (form::isPostBack()) {
         $file->globalid = $globalid;
         $file->field = $field;
         $file->description = request::post('description');
         $files = $file->upload();
         if (!$file->error() && isset($files[0]['path'])) {
             msg::success('圖片上傳成功', zotop::url('zotop/image/preview', array('globalid' => $globalid, 'field' => $field, 'image' => url::encode($files[0]['path']))));
         }
         msg::error($file->msg());
     }
     $page = new dialog();
     $page->set('title', '本地上傳');
     $page->set('navbar', $this->navbar($globalid, $field, $image));
     $page->set('alowexts', $file->upload->alowexts);
     $page->set('maxsize', $file->upload->maxsize);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:20,代碼來源:image.php

示例5: actionImageFromLocal

 public function actionImageFromLocal($globalid, $field, $image)
 {
     $upload = zotop::model('zotop.upload');
     $upload->alowexts = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
     if (form::isPostBack()) {
         $upload->bind('globalid', request::post('globalid'));
         $upload->bind('field', request::post('field'));
         $upload->bind('description', request::post('description'));
         $files = $upload->save();
         $image = $files[0];
         if ($upload->error() == 0 && $image) {
             msg::success($upload->msg(), zotop::url('zotop/upload/imagePreview', array('globalid' => $globalid, 'field' => $field, 'image' => url::encode($image['path']))));
         }
         msg::error($upload->msg());
     }
     $page = new dialog();
     $page->set('title', '本地上傳');
     $page->set('navbar', $this->navbar($globalid, $field, $image));
     $page->set('alowexts', $upload->alowexts);
     $page->set('maxsize', $upload->maxsize);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:22,代碼來源:upload.php

示例6: confirm

        ?>
</strong><br/>
	     				<i><?php 
        echo $paper->style->name;
        ?>
</i>
	     			</td>
		     		<td class="align-center"><?php 
        echo $paper->status == 'approved' ? '<span class="icon-approved">&#x2714;</span>' : '<span class="icon-pending">&#x2718;</span>';
        ?>
</td>
		     		<td><a href="<?php 
        echo url::routes_area();
        ?>
edit/<?php 
        echo url::encode($paper->name);
        ?>
" title="Edit <?php 
        echo $paper->name;
        ?>
" class="text-edit"><span>Edit</span></a> <a href="<?php 
        echo url::routes_area() . 'delete/' . $paper->id;
        ?>
" class="text-delete" title="Delete <?php 
        echo $paper->name;
        ?>
" onclick="return confirm('Do you really want to delete the paper item <?php 
        echo $paper->name;
        ?>
?');"><span>Delete</span></a></td>
		     	</tr>
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:31,代碼來源:index_list.php

示例7: foreach

"><span>Overview</span></a>
		</li>
		<li>
			<a href="javascript:void(null);" class="current"><span>Sheets</span></a>
		</li>
		<li>
			<a href="products/papers/technicals/index/<?php 
echo $paper->id;
?>
" ><span>Technical</span></a>
		</li>
	</ul><!--/sub-navigation -->
	
	<div class="navigation">
		<a href="<?php 
echo url::routes_area() . 'add/' . url::encode($paper->name);
?>
" class="button"><span>Add New Sheet</span></a>
	</div>
</div>

<?php 
if (count($paper->collections)) {
    ?>
	<?php 
    foreach ($paper->collections as $collection) {
        ?>
		<?php 
        foreach ($collection->pigments as $pigment) {
            ?>
			<?php 
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:31,代碼來源:index.php

示例8: array

	});
</script>
<div id="header">
	<h2 style="text-align:left;"><?php 
echo $title;
?>
</h2>
	<h3>
		<a href="<?php 
echo zotop::config('site.index');
?>
">網站首頁</a>
		<b>|</b>
		<a href="javascript:void(0);" class="addFavorite">加入收藏夾</a>
		<b>|</b>
		<a href="<?php 
echo zotop::url('zotop/login/shortcut', array('title' => url::encode($title . ' ' . zotop::config('site.name')), 'url' => url::encode(url::location())));
?>
">設為桌麵圖標</a>		
	</h3>
</div>

<?php 
block::header(array('title' => $title, 'icon' => 'user', 'action' => ''));
form::header(array('title' => '', 'description' => ' 請輸入您的帳戶和密碼登錄', 'class' => 'small'));
form::field(array('type' => 'text', 'label' => zotop::t('帳 戶(U)'), 'name' => 'username', 'value' => zotop::cookie('admin.username'), 'valid' => 'required:true'));
form::field(array('type' => 'password', 'label' => zotop::t('密 碼(P)'), 'name' => 'password', 'value' => '', 'valid' => 'required:true'));
form::buttons(array('type' => 'submit', 'value' => '登錄'), array('type' => 'button', 'name' => 'options', 'value' => '選項'));
form::footer();
block::footer();
$this->footer();
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:31,代碼來源:login.php

示例9: array

    ?>
"><?php 
    echo html::image($img['path']);
    ?>
<span class="zotop-icon zotop-icon-ok"></span></div>
			<div class="title">
				<a href="<?php 
    echo zotop::url('zotop/image/preview', array('globalid' => $globalid, 'field' => $field, 'image' => url::encode($img['path'])));
    ?>
">預覽</a>
				<a href="<?php 
    echo zotop::url('zotop/image/edit', array('image' => url::encode($img['path'])));
    ?>
" class="dialog">編輯</a>
				<a href="<?php 
    echo zotop::url('zotop/image/delete', array('image' => url::encode($img['path']), 'referer' => url::encode(url::location())));
    ?>
" class="confirm">刪除</a>
			</div>
		</li>
	<?php 
}
?>
	</ul>
</div>
<div class="clearfix"><?php 
echo $pagination;
?>
</div>
<div class="buttons">
	<?php 
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:31,代碼來源:library.php

示例10: array

		$('button[name=options]').click(function(){
			location.href = "<?php 
echo zotop::url('site://');
?>
";
		});
	});
</script>
<div id="topbar">
	<a href="<?php 
echo zotop::url('site://');
?>
">網站首頁</a>
	<b>|</b>
	<a href="javascript:void(0);" class="addFavorite">加入收藏夾</a>
	<b>|</b>
	<a href="<?php 
echo zotop::url('zotop/login/shortcut', array('title' => url::encode($title), 'url' => url::encode(url::location())));
?>
">設為桌麵圖標</a>		
</div>

<?php 
box::header(array('title' => $title, 'icon' => 'user', 'action' => ''));
form::header(array('title' => '', 'description' => '請輸入您的帳戶和密碼登錄', 'class' => 'small'));
form::field(array('type' => 'text', 'label' => zotop::t('帳 戶'), 'name' => 'username', 'value' => zotop::cookie('username'), 'valid' => 'required:true'));
form::field(array('type' => 'password', 'label' => zotop::t('密 碼'), 'name' => 'password', 'value' => '', 'valid' => 'required:true'));
form::buttons(array('type' => 'submit', 'value' => '登錄'), array('type' => 'button', 'name' => 'options', 'value' => '取消'));
form::footer();
box::footer();
$this->footer();
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:31,代碼來源:index.php

示例11: array

	//圖片預覽
	$(function(){
		$('#image-preview').zoomImage(500,300,true);
	});

</script>
<?php 
$this->navbar();
?>
<div style="text-align:right;padding:3px;">
	<span class="zotop-icon zotop-icon-delete"></span><a href="<?php 
echo zotop::url('zotop/image/delete', array('image' => url::encode($image['path']), 'referer' => url::encode(url::location())));
?>
" class="confirm">刪除圖片</a>
	<span class="zotop-icon zotop-icon-edit"></span><a href="<?php 
echo zotop::url('zotop/image/edit', array('image' => url::encode($image['path'])));
?>
" class="dialog">編輯圖片</a>
</div>

<div id="image-preview" style="margin:10px;text-align:center;height:300px;overflow:hidden;">
<?php 
echo html::image($image['path'], array('width' => '100%'));
?>
</div>
<div style="text-align:center;padding:3px;">
	<span>名稱:<?php 
echo $image['name'];
?>
 大小:<?php 
echo format::byte($image['size']);
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:31,代碼來源:preview.php

示例12: update

 public function update()
 {
     if ($this->access->allowed('papers', 'update')) {
         // check the inputs
         $input = Validation::factory($this->input->post())->pre_filter('trim')->add_rules('name', 'required')->add_rules('id', 'required');
         if ($input->validate()) {
             $paper = ORM::factory('paper')->find($this->input->post('id'));
             if ($paper->loaded) {
                 if ($this->input->post('name') != $paper->name) {
                     // check to make sure that the paper they are adding is unique
                     $existing = ORM::factory('paper')->where('name', $this->input->post('name'))->find();
                     if ($existing->loaded) {
                         $this->notification->add($this->i18n['system.paper.exists'], $this->input->post('name'));
                         url::redirect(url::area() . 'edit/' . $paper->name);
                         // redirect back to the edit page
                     }
                 }
                 $paper->colors = $this->input->post('colors') ? $this->input->post('colors') : array();
                 $paper->applications = $this->input->post('applications') ? $this->input->post('applications') : array();
                 $paper->characteristics = $this->input->post('characteristics') ? $this->input->post('characteristics') : array();
                 $paper->environmentals = $this->input->post('environmentals') ? $this->input->post('environmentals') : array();
                 $paper->status = $this->input->post('status');
                 $paper->name = $this->input->post('name');
                 $paper->description = $this->input->post('description');
                 $paper->brief = $this->input->post('brief');
                 $paper->availablity_id = $this->input->post('availablity_id');
                 $paper->price_site = $this->input->post('price_site');
                 $paper->price_style = $this->input->post('price_style');
                 $paper->type = $this->input->post('type');
                 $paper->popular = $this->input->post('popular') == 'true' ? true : false;
                 $paper->style_id = $this->input->post('style_id');
                 $ids = array();
                 if (is_array($this->input->post('features'))) {
                     // loop thorugh each of the features which were added and add them to the paper
                     foreach ($this->input->post('features') as $feature_name) {
                         $feature = orm::factory('feature');
                         $feature = $feature->set($feature_name);
                         $ids[] = $feature->id;
                     }
                 }
                 $ids = array_unique($ids);
                 // delete all the entreis for that paper/feature, then readd them.
                 ORM::factory('features_paper')->where('paper_id', $paper->id)->delete_all();
                 foreach ($ids as $key => $feature_id) {
                     $features_paper = ORM::factory('features_paper');
                     $features_paper->feature_id = $feature_id;
                     $features_paper->paper_id = $paper->id;
                     $features_paper->order = $key;
                     $features_paper->save();
                 }
                 $ids = array();
                 if (is_array($this->input->post('tips'))) {
                     // loop thorugh each of the features which were added and add them to the paper
                     foreach ($this->input->post('tips') as $tip_name) {
                         $tip = orm::factory('tip');
                         $tip = $tip->set($tip_name);
                         $ids[] = $tip->id;
                     }
                 }
                 $ids = array_unique($ids);
                 // delete all the entreis for that paper/feature, then readd them.
                 ORM::factory('papers_tip')->where('paper_id', $paper->id)->delete_all();
                 foreach ($ids as $key => $tip_id) {
                     $papers_tip = ORM::factory('papers_tip');
                     $papers_tip->tip_id = $tip_id;
                     $papers_tip->paper_id = $paper->id;
                     $papers_tip->order = $key;
                     $papers_tip->save();
                 }
                 $images = $this->input->post('images');
                 // check to see if we need to update the images (any of them)
                 if (count($images)) {
                     // make sure that the file location exists, if not create it
                     $cms = DOCROOT . 'application/' . SITE . '/media/cms/products/papers/' . $paper->id;
                     if (file::tree($cms)) {
                         foreach ($images as $type => $location) {
                             $paper->{$type} = $location;
                             if (file_exists(DOCROOT . 'upload/' . $location)) {
                                 //@todo change this so that the uploads folder is not part of the info sent in
                                 if (rename(DOCROOT . 'upload/' . $location, $cms . '/' . $location)) {
                                     $this->notification->add($this->i18n['cms.image.success'], $type);
                                 } else {
                                     $this->notification->add($this->i18n['cms.image.error'], $type);
                                 }
                             } else {
                                 $this->notification->add($this->i18n['cms.image.error'], $type);
                             }
                         }
                     } else {
                         $this->notification->add($this->i18n['cms.folder.error']);
                     }
                 }
                 if ($paper->save()) {
                     $this->notification->add($this->i18n['system.paper.success'], $paper->name);
                 } else {
                     $this->notification->add($this->i18n['system.paper.error'], $paper->name);
                 }
                 url::redirect(url::area() . 'edit/' . url::encode($paper->name));
             } else {
                 $this->notification->add($this->i18n['system.paper.error'], $this->input->post('name'));
//.........這裏部分代碼省略.........
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:101,代碼來源:papers.php

示例13: delete

 public function delete($id = NULL)
 {
     if ($this->access->allowed('sheets', 'delete')) {
         if ($id) {
             $sheet = ORM::factory('sheet')->find($id);
             $paper_name = $sheet->pigment->collection->paper->name;
             if ($sheet->loaded) {
                 if ($sheet->delete()) {
                     $this->notification->add($this->i18n['system.sheet.success']);
                 } else {
                     $this->notification->add($this->i18n['system.sheet.error']);
                 }
             } else {
                 $this->notification->add($this->i18n['system.sheet.failed']);
             }
         } else {
             $this->notification->add($this->i18n['system.sheet.failed']);
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::routes_area() . 'index/' . url::encode($paper_name));
     }
 }
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:25,代碼來源:sheets.php

示例14: date

"><?php 
        echo date('j F Y', $lightbox->created);
        ?>
</div>
	     			</td>
	     			<td width="20%"><?php 
        echo count($lightbox->papers);
        ?>
 item<?php 
        echo count($lightbox->papers) == 1 ? '' : 's';
        ?>
</td>
	     			<td width="30%">
	     				<a href="#todo" class="button style-account"><span>Email</span></a>
	     				<a href="<?php 
        echo url::routes_area() . 'view/' . $lightbox->creator->email . '/' . url::encode($lightbox->name);
        ?>
" class="button style-account"><span>Permalink</span></a>
	     			</td>
		     		<td width="20%" class="align-right"><a href="<?php 
        echo url::routes_area() . 'view/' . $lightbox->creator->email . '/' . rawurlencode($lightbox->name);
        ?>
" class="button button-account"><span>Edit</span></a> <a href="<?php 
        echo url::routes_area() . 'delete/' . $lightbox->id;
        ?>
" class="button button-account icon-remove" onclick="return confirm('Do you really want to delete this lightbox?');"><span>Delete</span></a></td>
		     	</tr>
	        <?php 
    }
    ?>
		<?php 
開發者ID:HIVE-Creative,項目名稱:spicers,代碼行數:31,代碼來源:index_list.php

示例15: array

<?php 
echo html::msg(zotop::t('<h2>如何安裝新模塊?</h2><div>1,安裝模塊前,請確認將該模塊文件夾上傳至服務器上的模塊目錄下麵目錄下麵({$modules})</div><div>2,上傳完成後,<a class="zotop-reload" href="javascript:location.reload();">刷新本頁麵</a>,模塊將會出現在下麵的待安裝模塊列表中,點擊模塊後麵的 <a>安裝</a>,根據係統提示完成模塊安裝</div>', array('modules' => ZOTOP_URL_MODULES)));
block::header('待安裝模塊');
if (empty($modules)) {
    echo '<div class="zotop-empty"><span>暫時沒有待安裝模塊</span></div>';
} else {
    $column = array();
    $column['logo w40 center'] = '標識';
    $column['name'] = '名稱';
    $column['version w50 center'] = '版本號';
    $column['manage edit'] = '安裝';
    $column['manage delete'] = '刪除';
    table::header('list', $column);
    foreach ($modules as $module) {
        $column = array();
        $column['logo center'] = html::image(empty($module['icon']) ? '$theme/image/skin/none.png' : $module['icon'], array('width' => '32px'));
        $column['name'] = '<a><b>' . $module['name'] . ' ( ' . $module['id'] . ' )</b></a><h5>' . $module['description'] . '</h5>';
        $column['version center'] = $module['version'];
        $column['manage edit'] = html::a(zotop::url('zotop/module/uninstalled', array('path' => url::encode($module['path']))), '安裝', array('class' => 'dialog'));
        $column['manage delete'] = html::a(zotop::url('zotop/module/delete', array('path' => url::encode($module['path']))), '刪除', array('class' => 'confirm'));
        table::row($column);
    }
    table::footer();
}
block::footer();
?>

<?php 
$this->bottom();
$this->footer();
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:30,代碼來源:uninstalled.php


注:本文中的url::encode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。