本文整理汇总了PHP中HTML::decode方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::decode方法的具体用法?PHP HTML::decode怎么用?PHP HTML::decode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::decode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editHandle
public function editHandle()
{
$user = Auth::user();
$nice_input_names = array('firstname' => trans('auth.firstname'), 'lastname' => trans('auth.lastname'));
$data = ['firstname' => e(Input::get('firstname')), 'lastname' => e(Input::get('lastname'))];
$rules = ['firstname' => 'alpha|min:2', 'lastname' => 'alpha|min:2'];
$email_changed = false;
if (e(Input::get('email')) != $user->email) {
$data['email'] = e(Input::get('email'));
$rules['email'] = 'required|email|unique:users,email,' . $user->id;
$email_changed = true;
}
$validator = $validator = Validator::make($data, $rules, [], $nice_input_names);
if ($validator->passes()) {
$user->firstname = e(Input::get('firstname'));
$user->lastname = e(Input::get('lastname'));
if ($email_changed) {
$confirmation_code = str_random(30);
$user->email = e(Input::get('email'));
$user->confirmed = 0;
$user->confirmation_code = $confirmation_code;
$data = ['body_message' => trans('auth.welcome_body'), 'confirmation_code' => $confirmation_code];
$email_tpl = trans('auth.welcome') . ' ' . $data['body_message'] . ' ' . ' ' . URL::route('verify-register', [$data['confirmation_code']]);
if (mail(e(Input::get('email')), trans('auth.welcome_subject'), HTML::decode($email_tpl))) {
$user->save();
return Redirect::route('logout');
}
}
$user->save();
return Redirect::back()->with('success', trans('user.account_updated'));
}
return Redirect::back()->withErrors($validator)->withInput();
}
示例2: edit
public function edit($id)
{
if (Request::isMethod('post')) {
$rules = array('title' => 'required|min:4', 'link' => 'required', 'content' => 'required|min:100', 'published_at' => 'required', 'meta_description' => 'max:500', 'meta_keywords' => 'required');
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to("admin/post/{$id}/edit")->withErrors($validator)->withInput(Input::except(''));
} else {
$table = Post::find($id);
$table->title = e(Input::get('title'));
$table->link = Input::get('link');
$table->user_id = Auth::user()->id;
$table->content = e(Input::get('content'));
$table->meta_title = Input::get('meta_title') ? Input::get('meta_title') : $table->title;
$table->meta_description = Input::get('meta_description') ? Input::get('meta_description') : Str::limit(strip_tags(HTML::decode($table->content)), 155);
$table->meta_keywords = Input::get('meta_keywords');
$table->published_at = Post::toDate(Input::get('published_at'));
$table->active = Input::get('active', 0);
if ($table->save()) {
$name = trans("name.{$this->name}");
return Redirect::to("admin/{$this->name}")->with('success', trans("message.{$this->action}", ['name' => $name]));
}
return Redirect::to("admin/{$this->name}")->with('error', trans('message.error'));
}
}
return View::make("admin.{$this->name}.{$this->action}", ['item' => Post::find($id), 'name' => $this->name, 'action' => $this->action]);
}
示例3: postResendValidationEmail
public function postResendValidationEmail()
{
$validator = Validator::make(Input::all(), User::$resend_validation_rules, [], ['g-recaptcha-response' => 'captcha']);
if ($validator->fails()) {
return Redirect::back()->withInput()->withErrors($validator);
}
$user = User::where('email', Input::get('email'))->first();
$confirmation_code = str_random(30);
$user->confirmation_code = $confirmation_code;
if ($user->save()) {
$data = ['body_message' => trans('auth.welcome_body'), 'confirmation_code' => $confirmation_code];
// Mail::send('emails.welcome', $data, function($message)
// {
// $message->from(Config::get('app.no_reply_email'));
//
// $message->to(Input::get('email'))->subject(trans('auth.welcome_subject'));
// });
$email_tpl = trans('auth.welcome') . ' ' . $data['body_message'] . ' ' . ' ' . URL::route('verify-register', [$data['confirmation_code']]);
if (mail(e(Input::get('email')), trans('auth.welcome_subject'), HTML::decode($email_tpl))) {
return Redirect::to('users/login')->with('success', trans('auth.resend_success'));
}
}
}
示例4: strip
/**
* 反引用一个经过 e(htmlentities)和 addslashes 处理的字符串
* @param string $string 待处理的字符串
* @return 转义后的字符串
*/
function strip($string)
{
return stripslashes(HTML::decode($string));
}
示例5: testRepeatedOutput
public function testRepeatedOutput()
{
$checkbox = Former::checkbox('foo');
$content = HTML::decode($checkbox);
$content = HTML::decode($checkbox);
$this->assertEquals($content, Former::checkbox('foo')->__toString());
}
示例6: empty
@if ($logs)
@foreach ($logs as $type => $files)
@if ( ! empty($files['logs']))
<?php
$count = count($files['logs']);
?>
@foreach ($files['logs'] as $app => $file)
@if ( ! empty($file))
<li class="nav-header">{{ ($count > 1 ? $app.' - '.$files['sapi'] : $files['sapi']) }}</li>
<ul class="nav nav-list">
<?php
foreach ($file as $index => $f) {
if ($index > 50) {
break;
}
echo HTML::decode(HTML::nav_item($url . '/' . $app . '/' . $type . '/' . $f, $f));
}
?>
</ul>
@endif
@endforeach
@endif
@endforeach
@endif
</ul>
</div>
<div id="delete_modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
示例7: getSocialLinks
/**
* Generates social login links based on what is enabled
* @return string
*/
protected function getSocialLinks()
{
$socialite_enable = [];
$socialite_links = '';
if (getenv('BITBUCKET_CLIENT_ID') != '') {
$socialite_enable[] = link_to_route('auth.provider', trans('labels.login_with', ['social_media' => 'Bit Bucket']), 'bitbucket');
}
if (getenv('FACEBOOK_CLIENT_ID') != '') {
$socialite_enable[] = \HTML::decode(link_to_route('auth.provider', trans('labels.login_with', ['social_media' => '<i class="fa fa-facebook-square fa-lg" ></i>']), 'facebook', ['class' => 'btn btn-warning']));
}
if (getenv('GOOGLE_CLIENT_ID') != '') {
$socialite_enable[] = \HTML::decode(link_to_route('auth.provider', trans('labels.login_with', ['social_media' => ' <i class="fa fa-google-plus-square fa-lg" ></i>']), 'google', ['class' => 'btn btn-primary']));
}
if (getenv('GITHUB_CLIENT_ID') != '') {
$socialite_enable[] = link_to_route('auth.provider', trans('labels.login_with', ['social_media' => 'Github']), 'github');
}
if (getenv('LINKEDIN_CLIENT_ID') != '') {
$socialite_enable[] = \HTML::decode(link_to_route('auth.provider', trans('labels.login_with', ['social_media' => '<i class="fa fa-linkedin-square fa-lg" ></i>']), 'linkedin', ['class' => 'btn btn-success']));
}
if (getenv('TWITTER_CLIENT_ID') != '') {
$socialite_enable[] = link_to_route('auth.provider', trans('labels.login_with', ['social_media' => 'Twitter']), 'twitter');
}
for ($i = 0; $i < count($socialite_enable); $i++) {
$socialite_links .= ($socialite_links != '' ? ' | ' : '') . $socialite_enable[$i];
}
return $socialite_links;
}
示例8: function
<?php
HTML::macro('glyph', function ($what, $class = '') {
$a = ['class' => "glyphicon glyphicon-{$what}"];
if (!empty($class)) {
$a['class'] .= ' ' . $class;
}
return HTML::span('', $a);
});
HTML::macro('pageHeader', function ($innards) {
return '<div class="page-header"><h1>' . $innards . '</h1></div>';
});
HTML::macro('label', function ($name, $value = null, $options = array(), $optional = false) {
if ($optional) {
return HTML::label_optional($name, $value, $options);
}
return Form::label($name, $value, $options);
});
HTML::macro('label_optional', function ($name, $value = null, $options = array()) {
$optional = ' <small><span class="text-muted label-optional">(optional)</span></small>';
return HTML::decode(Form::label($name, $value . $optional, $options));
});
HTML::macro('bootstrap_label', function ($what, $type = null, $attributes = null, $class = '') {
// default | primary | success | info | warning | danger
$type = is_null($type) ? 'default' : $type;
$class = !empty($class) ? ' ' . $class : $class;
return '<span class="label label-' . $type . $class . '"' . HTML::atts($attributes) . '>' . $what . '</span>';
});
示例9: array
@extends('admin.layout')
@section('sidebar')
<h2>Слайды</h2>
@if(isset($slides_menu) )
@foreach ($slides_menu as $key => $post)
<li class="dropdown active" >
{{ HTML::link('admin/slider/'.$post->id, $post->name) }}
</li>
@endforeach
@endif
<p>
<?php
echo HTML::decode(HTML::link('/admin/slider/add', '<i class="glyphicon glyphicon-plus"></i> Добавить', array('class' => 'addNews')));
?>
</p>
@stop
@section('content')
<div>
<h3>Слайд</h3>
<br>
{{ Form::open(array('url' => 'admin/slider/'.(isset($row['id'])?$row['id']:'') , 'class' => 'form-group', 'files' => true)) }}
<div class="tab-content">
示例10: array
<ul class="dropdown-menu">
@if(isset($type_page)&&count($type_page)>0)
@foreach ($type_page as $type => $name)
<li> {{ HTML::link('admin/content/'.$type, $name)}}</li>
@endforeach
@endif
</ul>
</li>
<li {{ (Request::is('admin/user*')) ? 'class="active"' : '' }} > {{ HTML::link('admin/user', 'Пользователи'); }} </li>
<li> {{ HTML::link('#', ''); }} </li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<?php
echo HTML::decode(HTML::link('/', '<i class="glyphicon glyphicon-home"></i> SITE', array('class' => 'addNews')));
?>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Настройки <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> {{ HTML::link('admin/settings', 'Настройки'); }} </li>
<li> {{ HTML::link('/', 'Перейти на сайт', array('target' => '_blank')); }} </li>
<li> {{ HTML::link('auth/logout', 'Выйти'); }} </li>
<li> {{ HTML::link('#', ''); }} </li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
@endif
示例11:
<?php
}
?>
</li>
<li>
<?php
echo HTML::decode(link_to_route('admin.users', '<i class="fa fa-dashboard"></i><span>Usuarios</span>'));
?>
</li>
<li>
<?php
echo HTML::decode(link_to_route('admin.specialfee', '<i class="fa fa-dashboard"></i><span>Cuotas Especiales</span>'));
?>
</li>
<!--
<li class="treeview"><a href="#"> <i class="fa fa-laptop"></i> <span>UI
Elements</span> <i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="pages/UI/general.html"><i class="fa fa-circle-o"></i>
General</a></li>
<li><a href="pages/UI/icons.html"><i class="fa fa-circle-o"></i>
Icons</a></li>
<li><a href="pages/UI/buttons.html"><i class="fa fa-circle-o"></i>
Buttons</a></li>
<li><a href="pages/UI/sliders.html"><i class="fa fa-circle-o"></i>
示例12: decode_link_to
function decode_link_to($url, $title = null, $attributes = array(), $secure = null)
{
return HTML::decode(link_to($url, $title, $attributes, $secure));
}
示例13: __toString
/**
* Outputs the current body in memory
*
* @return string A <tbody> with content
*/
public function __toString()
{
if (!$this->tbody) {
return FALSE;
}
// Fetch ignored columns
if (!$this->ignore) {
$this->ignore = Kohana::$config->load('tb.table.ignore');
}
// Fetch variables
$content = $this->tbody;
// Open table body
$html = '<tbody>';
// Iterate through the data
foreach ($content as $row) {
$html .= '<tr>';
$columnCount = 0;
$data = is_object($row) ? $row->attributes : $row;
// Reorder columns if necessary
if ($this->order) {
$data = array_merge(array_flip($this->order), $data);
}
// Read the data row with ignored keys
foreach ($data as $column => $value) {
if (in_array($column, (array) $this->ignore)) {
continue;
}
// Check for replacing columns
$replace = Arr::get($this->columns, $column);
if ($replace) {
$value = is_callable($replace) ? $replace($row) : $replace;
$value = static::replace_keywords($value, $data);
}
$columnCount++;
$html .= static::appendColumn($column, $value);
}
// Add supplementary columns
if ($this->columns) {
foreach ($this->columns as $class => $column) {
// Check for replacing columns
if (array_key_exists($class, $data)) {
continue;
}
// Calculate closures
if (is_callable($column)) {
$column = $column($row);
}
// Parse and decode content
$column = static::replace_keywords($column, $data);
$column = HTML::decode($column);
// Wrap content in a <td> tag if necessary
$columnCount++;
$html .= static::appendColumn($class, $column);
}
}
$html .= '</tr>';
// Save new number of columns
if ($columnCount > $this->numberColumns) {
$this->numberColumns = $columnCount;
}
}
$html .= '</tbody>' . PHP_EOL;
// Empty data from this body
$this->ignore = array();
$this->columns = array();
$this->tbody = NULL;
return $html;
}
示例14: foreach
<?php
}
?>
</div>
<!-- msgBox que end -->
<div class="msgBox ans">
<h3>診所回覆</h3>
<?php
if ($reply !== null) {
?>
<?php
if ($isShowPost) {
?>
<p><?php
echo \HTML::decode($reply->content);
?>
</p>
<?php
if (sizeof($tags) > 0) {
?>
<div class="tags">
<h4>延伸閱讀:</h4>
<?php
foreach ($tags as &$t) {
?>
<a href="<?php
echo route('frontend.service_faq.article', array('type' => 'faq', 'id' => $t->id));
?>
"><?php
echo $t->title;
示例15: route
<td><time datetime="<?php
echo $b->d;
?>
"><?php
echo $b->d;
?>
</time></td>
<td><a href="<?php
echo route('frontend.board.post', array($b->id));
?>
"><span><?php
echo HTML::decode($b->topic);
?>
</span></a></td>
<td class="userName"><?php
echo HTML::decode($b->name);
?>
</td>
<td class="viewCount"><?php
echo $b->count_num;
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</article>
<!-- commentList end -->