本文整理汇总了PHP中HTML::link方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::link方法的具体用法?PHP HTML::link怎么用?PHP HTML::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply
public function apply(Transformable $transformable)
{
$file = \File::get(public_path('assets/img/borders.png'));
$img = base64_encode($file);
$data = str_ireplace(["\r", "\n"], '', $transformable->getContents());
$data = preg_replace("~<(/?(br|p|dd))[^>]*?>~i", '<\\1>', $data);
$data = preg_replace("~</(p|dd)>~i", '', $data);
$data = preg_replace("~<(br|p|dd)>~i", static::LINEBREAK, $data);
$data = preg_replace('/[ ]{2,}/', ' ', $data);
$data = preg_replace("/" . static::LINEBREAK . "[ ]+/s", static::LINEBREAK . " ", $data);
$data = str_replace(static::LINEBREAK, '<p>', $data);
$page = $transformable->page;
$author = $page->author;
$charset = $transformable->charset ?: 'utf-8';
$title = $author->fio . " - " . $page->title;
$link = \HTML::link(path_join("http://samlib.ru", $author->absoluteLink()), $author->fio) . " - " . \HTML::link(path_join("http://samlib.ru", $page->absoluteLink()), $page->title);
$annotation = $page->annotation;
$contents = $data;
$downloaded = \Lang::get('pages.pages.downloaded', ['url' => \Request::fullUrl()]);
if ($charset != 'utf-8') {
$e = app('charset-encoder');
$c = $e->remap($charset, true);
$title = $e->transform($title, 'utf-8', $c);
$link = $e->transform($link, 'utf-8', $c);
$annotation = $e->transform($annotation, 'utf-8', $c);
$downloaded = $e->transform($downloaded, 'utf-8', $c);
}
$view = view('pages.html-download', compact('img', 'charset', 'title', 'link', 'annotation', 'contents', 'downloaded'));
$transformable->setContents((string) $view);
$transformable->setType(static::EXTENSION);
return $transformable;
}
示例2: onGetHeadlineValue
/**
* @param DocumentInterface $document
* @param mixed $value
*
* @return mixed
*/
public function onGetHeadlineValue(DocumentInterface $document, $value)
{
$documents = $document->getAttribute($this->getRelationName())->map(function (DocumentInterface $doc) {
return \HTML::link($doc->getEditLink(), $doc->getTitle(), ['class' => 'popup']);
})->all();
return !empty($documents) ? implode(', ', $documents) : null;
}
示例3: login
public function login()
{
$rules = array('rut' => 'required|between:8,9|alpha_num|rut|exist_rut');
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
if (Request::ajax()) {
return json_encode('ERROR');
}
return Redirect::back()->withErrors($validator->messages())->withInput();
}
Event::fire('carga_cliente', array(Input::get('rut')));
$ultima_respuesta = Event::fire('ya_respondio')[0];
if (!is_null($ultima_respuesta)) {
$msg = array('data' => array('type' => 'warning', 'title' => Session::get('user_name'), 'text' => 'En el actual periodo, ya registramos tus respuestas con fecha <b>' . $ultima_respuesta->format('d-m-Y') . '</b> a las <b>' . $ultima_respuesta->toTimeString() . '</b>, ¿Deseas actualizar esta información?'), 'options' => array(HTML::link('#', 'NO', array('class' => 'col-xs-4 col-sm-4 col-md-3 btn btn-default btn-lg text-uppercase', 'id' => 'btn_neg')), HTML::link('encuestas', 'SÍ', array('class' => 'col-xs-4 col-sm-4 col-md-3 btn btn-hot btn-lg text-uppercase pull-right'))));
if (Request::ajax()) {
return json_encode($msg);
}
return View::make('messages')->with('msg', $msg);
} else {
if (Request::ajax()) {
return json_encode('OK');
}
return Redirect::to('encuestas');
}
}
示例4: read_multiple
public function read_multiple($view, $accounts)
{
$view->page_header(function ($view) {
$view->float_right(function ($view) {
$view->search();
});
$view->title(__('admin::account.read_multiple.title'));
});
$view->notifications();
$view->table(function ($table) use($accounts) {
$table->header(array('name' => array('title' => __('admin::account.read_multiple.table.name'), 'attributes' => array('class' => 'first big')), 'email' => __('admin::account.read_multiple.table.email'), 'roles' => __('admin::account.read_multiple.table.roles'), 'buttons' => array('attributes' => array('class' => 'buttons last'))));
$table->sortable(array('name', 'email'));
$table->rows($accounts);
$table->no_results(function ($table) {
$table->well(function ($table) {
$table->raw(__('admin::account.read_multiple.table.no_results'));
});
});
$table->display(array('roles' => function ($account) {
$roles = '';
if (isset($account->roles)) {
foreach ($account->roles as $role) {
$roles .= '<b>' . $role->lang->name . '</b><br>' . $role->lang->description;
}
}
return $roles;
}, 'buttons' => function ($account) {
return HTML::link(prefix('admin') . 'account/edit/' . $account->id, '<span class="icon-pencil"></span>', array('class' => 'btn btn-small')) . HTML::link(prefix('admin') . 'account/delete/' . $account->id, '<span class="icon-trash icon-white"></span>', array('class' => 'btn btn-primary'));
}));
});
$view->links($accounts);
$view->float_right(function ($view) {
$view->button(prefix('admin') . 'account/add', 'Add account', 'primary');
});
}
示例5: create
public static function create($view)
{
$view->tabs(function ($tabs) {
$tabs->tab('Module Settings', function ($view) {
$view->text('name', __('admin::module.create.form.name'), Input::old('name'));
$view->actions(function ($view) {
$view->next_tab('Next up, add some schemas <i class="icon-arrow-right icon-white"></i>', 'primary');
});
});
$tabs->tab('Schemas', function ($view) {
$view->table(function ($table) {
$table->header(array('name' => array('title' => __('admin::account.read_multiple.table.name'), 'attributes' => array('class' => 'first big')), 'relationships', 'buttons' => array('attributes' => array('class' => 'buttons last'))));
$table->no_results(function ($table) {
$table->well(function ($table) {
$table->raw(__('admin::account.read_multiple.table.no_results'));
});
});
$table->display(array('relationships' => function ($schema) {
$relationships = '';
if (isset($schema->relationships)) {
foreach ($schema->relationships as $relationship) {
$relationships .= '<b>' . $relationship->name . '</b><br>' . $relationship->type;
}
}
return $relationships;
}, 'buttons' => function ($schema) {
return HTML::link(prefix('admin') . 'module/add/', '<span class="icon-pencil"></span>', array('class' => 'btn btn-small')) . HTML::link(prefix('admin') . 'module/add/', '<span class="icon-trash icon-white"></span>', array('class' => 'btn btn-primary'));
}));
});
$view->button('#add-schema', 'Add Schema', 'primary');
});
});
}
示例6: addnav
/**
* Add a new navigation item or title, if $link is false.
*
* @param string $title the title/name of the navigation item
* @param null|string $link the link of the navigation item
*/
public static function addnav($title, $link = null)
{
if (!$link) {
$output = '<p class="nav-head">— ' . __($title) . ' —</p>';
Template::get_instance()->set_output('navigation', __($output));
} else {
Template::get_instance()->set_output('navigation', HTML::link($link . '?' . LOGD_Core::create_random_uri_string(), __($title)));
}
}
示例7: redirect
/**
* Redirect user to other URI
* @param string $url - URI we need to relocate user
*/
public static function redirect($url = '')
{
if (APPLICATION) {
header('Location: /' . trim($url, '/'));
} else {
header('Location: ' . HTML::link($url));
}
exit(0);
}
示例8: pics
public function pics($data)
{
$name = HTML::link('products/view/' . $data['_id'], $data['productName']);
if (isset($data['thumbnail_url']) && count($data['thumbnail_url'])) {
$display = HTML::image($data['thumbnail_url'][0] . '?' . time(), $data['filename'][0], array('style' => 'min-width:100px;', 'id' => $data['_id']));
return $display . '<br /><span class="img-more" id="' . $data['_id'] . '">more images</span>';
} else {
return $name;
}
}
示例9: pics
public function pics($data)
{
$name = HTML::link('products/view/' . $data['_id'], $data['productName']);
if (isset($data['thumbnail_url']) && count($data['thumbnail_url'])) {
$display = HTML::image($data['thumbnail_url'][0] . '?' . time(), $data['filename'][0], array('style' => 'min-width:100px;', 'id' => $data['_id']));
return $data['songTitle'] . '<br />' . $display;
} else {
return $name;
}
}
示例10: testGeneratingLink
/**
* Test generating proper link
*
* @group laravel
*/
public function testGeneratingLink()
{
$html1 = HTML::link('foo');
$html2 = HTML::link('foo', 'Foobar');
$html3 = HTML::link('foo', 'Foobar', array('class' => 'btn'));
$html4 = HTML::link('http://google.com', 'Google');
$this->assertEquals('<a href="http://localhost/index.php/foo">http://localhost/index.php/foo</a>', $html1);
$this->assertEquals('<a href="http://localhost/index.php/foo">Foobar</a>', $html2);
$this->assertEquals('<a href="http://localhost/index.php/foo" class="btn">Foobar</a>', $html3);
$this->assertEquals('<a href="http://google.com">Google</a>', $html4);
}
示例11: get_contacts
public function get_contacts()
{
if (Auth::guest()) {
$s = HTML::link('login', 'Login') . ' or ' . HTML::link('verify', 'Register') . ' to view';
} else {
$u = User::find($this->user_id);
// $s = 'Contacts for '.print_r($u, true);
$s = $u->email . '<br>' . $u->phone_1;
}
return $s;
}
示例12: postUpdate
public function postUpdate($id = '')
{
$cartography_user = CartographyUser::find($id);
if (Input::get('password_1') != '') {
if (Input::get('password_1') != Input::get('password_2')) {
return "As senhas devem corresponder. " . HTML::link($this->route . '/create', 'Voltar');
} else {
$cartography_user->password = md5(Input::get('password_1'));
}
}
$cartography_user->name = Input::get('name');
$cartography_user->usertype = Input::get('usertype');
$cartography_user->save();
return Redirect::to($this->route)->with(array('msg_success' => 'Cartografia adicionada com sucesso'));
}
示例13: uploadFiles
public function uploadFiles($files)
{
if (!$this->form_block_id) {
throw new \Exception('form block id must be set before saving files');
}
$formData = $this->content ? unserialize($this->content) : [];
foreach ($files as $field => $requestFile) {
/** @var \Illuminate\Http\UploadedFile $requestFile */
$uploadFolder = '/uploads/system/forms/' . $this->form_block_id;
$fullUploadPath = public_path() . $uploadFolder;
if (!file_exists($fullUploadPath)) {
mkdir($fullUploadPath, 0755, true);
}
$uniqueFilename = $field . ' ' . $this->id . ' ' . $requestFile->getClientOriginalName();
$requestFile->move($uploadFolder, $uniqueFilename);
$formData[$field] = \HTML::link($uploadFolder . '/' . $uniqueFilename, $uniqueFilename);
}
$this->content = serialize($formData);
}
示例14: backendBreadcrumbs
/**
* Generate breadcrumbs from array for backend
* @param array $bread - array with names and links
* @return string - breadcrumbs HTML
*/
public static function backendBreadcrumbs($bread)
{
if (count($bread) <= 1) {
return '';
}
$last = $bread[count($bread) - 1];
unset($bread[count($bread) - 1]);
if (!count($bread)) {
return '';
}
$first = $bread[0];
unset($bread[0]);
$html = '<div class="crumbs"><ul class="breadcrumb">';
$html .= '<li><i class="fa-home"></i><a href="' . HTML::link($first['link']) . '"> ' . $first['name'] . '</a></li>';
foreach ($bread as $value) {
$html .= '<li><a href="' . HTML::link($value['link']) . '"> ' . $value['name'] . '</a></li>';
}
$html .= '<li class="current" style="color: #949494 !important;"> ' . $last['name'] . '</li>';
$html .= '</ul></div>';
return $html;
}
示例15: link
/**
* Create a HTML page link.
*
* @param int $page
* @param string $text
* @param string $class
* @return string
*/
protected function link($page, $text, $class)
{
$query = '?page=' . $page . $this->appendage($this->appends);
return HTML::link(URI::current() . $query, $text, compact('class'), Request::secure());
}