当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML::entities方法代码示例

本文整理汇总了PHP中HTML::entities方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::entities方法的具体用法?PHP HTML::entities怎么用?PHP HTML::entities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML的用法示例。


在下文中一共展示了HTML::entities方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: html

 public function html()
 {
     $this->render_field->set('tag', 'option')->text($this->field->alias())->attr('value', HTML::entities($this->render_field->value));
     if ($this->field->parent()->val() == $this->render_field->value) {
         $this->render_field->attr('selected', 'selected');
     }
 }
开发者ID:salesignighter,项目名称:kohana-formo,代码行数:7,代码来源:core.php

示例2: before

 /**
  * Construct controller
  */
 public function before()
 {
     parent::before();
     $this->page_title = __('Forum');
     // Generic page actions
     $this->page_actions['new-posts'] = array('link' => Route::url('forum'), 'text' => '<i class="icon-comment icon-white"></i> ' . __('New posts'));
     // Forum areas dropdown
     $groups = Model_Forum_Group::factory()->find_all();
     $areas = array();
     foreach ($groups as $group) {
         $divider = false;
         foreach ($group->areas() as $area) {
             if (Permission::has($area, Model_Forum_Area::PERMISSION_READ, self::$user)) {
                 $divider = true;
                 $areas[] = array('link' => Route::model($area), 'text' => HTML::entities($area->name));
             }
         }
         if ($divider) {
             $areas[] = array('divider' => true);
         }
     }
     array_pop($areas);
     $this->page_actions['areas'] = array('link' => Route::url('forum_group'), 'text' => '<i class="icon-folder-open icon-white"></i> ' . __('Areas'));
     $this->page_actions['area'] = array('link' => Route::url('forum_group'), 'text' => '', 'dropdown' => $areas);
     if (self::$user) {
         $this->page_actions['private-messages'] = array('link' => Forum::private_messages_url(), 'text' => '<i class="icon-envelope icon-white"></i> ' . __('Private messages'));
     }
 }
开发者ID:anqh,项目名称:forum,代码行数:31,代码来源:forum.php

示例3: action_create

 public function action_create()
 {
     // form post handling
     if (isset($_POST) && Valid::not_empty($_POST)) {
         // validate
         $post = Validation::factory($_POST)->rule('email', 'not_empty')->rule('email', 'email')->rule('email', 'email_domain')->rule('username', 'not_empty')->rule('username', Kohana::$config->load('ko32example.account.create.username.format'))->rule('username', 'min_length', array(':value', Kohana::$config->load('ko32example.account.create.username.min_length')))->rule('username', 'max_length', array(':value', Kohana::$config->load('ko32example.account.create.username.max_length')))->rule('password', 'not_empty')->rule('password', 'min_length', array(':value', Kohana::$config->load('ko32example.account.create.password.min_length')))->rule('password', array($this, 'pwdneusr'), array(':validation', ':field', 'username'));
         if ($post->check()) {
             // save
             $model = ORM::factory('user');
             $model->values(array('email' => $post['email'], 'username' => HTML::entities(strip_tags($post['username'])), 'password' => $post['password']));
             try {
                 $model->save();
                 $model->add('roles', ORM::factory('role')->where('name', '=', 'login')->find());
                 $model->add('roles', ORM::factory('role')->where('name', '=', 'participant')->find());
                 // success login
                 if (Auth::instance()->login($post['username'], $post['password'])) {
                     if (Auth::instance()->logged_in('participant')) {
                         // sucessfully loged
                         $this->request->redirect('dashboard');
                     }
                 } else {
                     //TODO error
                 }
             } catch (ORM_Validation_Exception $e) {
                 $errors = $e->errors('user');
             }
         } else {
             $errors = $post->errors('user');
         }
     }
     // TODO i18n
     $this->template->title = __('Create an account');
     // display
     $this->template->content = View::factory('account/create')->bind('post', $post)->bind('errors', $errors);
 }
开发者ID:Oaks,项目名称:kohana-3.2-example,代码行数:35,代码来源:account.php

示例4: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $whereAmI = $this->ruta . $this->listOneBreadcrumb('editar localidad', '', 1);
     $departamentos = Departamento::listByFullName();
     $localidad = Localidad::with('departamento')->with('departamento.provincia')->with('departamento.provincia.pais')->findOrFail($id);
     $donde_estoy[0] = \HTML::entities(\Html::linkRoute('cities.localidades.index', 'localidades'));
     $data = ['whereAmI' => $whereAmI, 'departamentos' => $departamentos, 'donde_estoy' => $donde_estoy, 'localidad' => $localidad];
     return view('admin.cities.localidades.edit', $data);
 }
开发者ID:aabcehmt,项目名称:fe,代码行数:15,代码来源:LocalidadController.php

示例5: saveContract

 public function saveContract($id)
 {
     $form = DeliveryForm::find($id);
     if ($form->contract_type->secondary_lang) {
         $rules = ['user_email' => 'required', 'company_name' => 'required', 'user_name' => 'required', 'user_surname' => 'required', 'user_patronymic' => 'required', 'requisites' => 'required', 'en_company_name' => 'required', 'en_user_name' => 'required', 'en_user_surname' => 'required', 'en_user_patronymic' => 'required', 'en_requisites' => 'required'];
     } else {
         $rules = ['user_email' => 'required', 'company_name' => 'required', 'user_name' => 'required', 'user_surname' => 'required', 'user_patronymic' => 'required', 'requisites' => 'required'];
     }
     if ($form->contract_type->id == 6) {
         $rules['tax_content'] = 'required';
     }
     $data = Input::except('_token');
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         return Redirect::back()->withInput()->withErrors($validator->messages());
     }
     if (isset($form->user_id) && $this->user_id == $form->user_id) {
         $form->user_email = HTML::entities(Input::get('user_email'));
         $form->company_name = HTML::entities(Input::get('company_name'));
         $form->user_name = HTML::entities(Input::get('user_name'));
         $form->user_surname = HTML::entities(Input::get('user_surname'));
         $form->user_patronymic = HTML::entities(Input::get('user_patronymic'));
         $form->requisites = HTML::entities(Input::get('requisites'));
         if ($form->contract_type->secondary_lang) {
             $form->en_company_name = HTML::entities(Input::get('en_company_name'));
             $form->en_user_name = HTML::entities(Input::get('en_user_name'));
             $form->en_user_surname = HTML::entities(Input::get('en_user_surname'));
             $form->en_user_patronymic = HTML::entities(Input::get('en_user_patronymic'));
             $form->en_requisites = HTML::entities(Input::get('en_requisites'));
         }
         if ($form->contract_type->id == 6) {
             if (!$form->tax) {
                 $tax = new Tax(['content' => HTML::entities(Input::get('tax_content'))]);
                 $tax = $form->tax()->save($tax);
             } else {
                 $form->tax->content = HTML::entities(Input::get('tax_content'));
                 $form->tax->save();
             }
         }
         $form->user_confirmed = 1;
         $form->save();
         return Redirect::to('/profile/forms/edit/' . $id);
     } else {
         return Redirect::to('/login');
     }
 }
开发者ID:imsgithub,项目名称:hotlot.com,代码行数:46,代码来源:DeliveryFormsController.php

示例6: function

<?php

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
$factory->define(App\User::class, function (Faker\Generator $faker) {
    return ['name' => $faker->name, 'username' => $faker->userName, 'email' => $faker->email, 'password' => Hash::make('password'), 'remember_token' => str_random(10)];
});
$factory->define(App\Post::class, function (Faker\Generator $faker) {
    return ['post_content' => HTML::entities('<p>' . implode('</p><p>', $faker->paragraphs(random_int(3, 10))) . '</p>'), 'post_title' => HTML::entities($faker->sentence()), 'post_featured_image_url' => "http://lorempixel.com/1000/500/food/" . random_int(1, 10), 'created_at' => $faker->dateTime, 'updated_at' => $faker->dateTime];
});
$factory->define(App\Comment::class, function (Faker\Generator $faker) {
    return ['comment_content' => $faker->paragraph()];
});
开发者ID:kfwong,项目名称:cvwo-assignment-1,代码行数:21,代码来源:ModelFactory.php

示例7:

<?php

/**
 * @var string $bill_id
 * @var string $textStatus
 */
?>
<html>
<head>
	<title>Изменения в счёте</title>
</head>
<body>
<p>
	Счёт № <?php 
echo HTML::entities($bill_id);
?>
 <?php 
echo HTML::entities($textStatus);
?>
</p>
</body>
</html>
开发者ID:fintech-fab,项目名称:qiwi-gate,代码行数:22,代码来源:sendCallbackMail.php

示例8: foreach

				<td><?php 
    echo $mail->getDatetimeSent();
    ?>
</td>
				<td>
					<?php 
    foreach ($msg->getTo() as $email => $name) {
        if ($name) {
            echo '&lt;' . $name . '&gt; ';
        }
        echo $email;
    }
    ?>
				</td>
				<td><?php 
    echo $msg->getSubject();
    ?>
</td>
				<td>
					<?php 
    echo $msg->getContentType() == 'text/html' ? $msg->getBody() : HTML::entities($msg->getBody());
    ?>
				</td>
			</tr>
			<?php 
}
?>
		</tbody>
	</table>
</div>
开发者ID:samwilson,项目名称:kohana_mailqueue,代码行数:30,代码来源:table.php

示例9: foreach

    ?>
"</th>
        </tr>
        <?php 
    foreach ($stats as $num => $query) {
        ?>
            <tr class="<?php 
        echo Text::alternate('odd', 'even');
        ?>
">
                <td><?php 
        echo $num + 1;
        ?>
</td>
                <td><?php 
        echo HTML::entities($query['name']);
        ?>
</td>
                <td><?php 
        echo number_format($query['time'] * 1000, 3);
        ?>
 ms</td>
                <td><?php 
        echo number_format($query['memory'] / 1024, 3);
        ?>
 kb</td>
            </tr>
            <?php 
    }
    ?>
        <?php 
开发者ID:nexeck,项目名称:kohana-debugger,代码行数:31,代码来源:database.php

示例10:

<?php

/**
 * @var string $themeName
 * @var string $baseMessage
 * @var string $comment
 */
?>
<html>
<head>
	<title><?php 
echo HTML::entities($themeName);
?>
</title>
</head>
<body>
<p>
	 <?php 
echo HTML::entities($baseMessage);
?>
.<br>

	<br>  <?php 
echo HTML::entities($comment);
?>
</p>
</body>
</html>
开发者ID:PopovDmitry,项目名称:fintech-fab.ru,代码行数:28,代码来源:NoticeThemes.php

示例11: as_html

 /**
  * Replace HTML entities in humanize
  * @param  string $currency optionally convert to another currency
  * @return string
  */
 public function as_html($currency = NULL)
 {
     return HTML::entities($this->humanize($currency));
 }
开发者ID:openbuildings,项目名称:jam-monetary,代码行数:9,代码来源:Price.php

示例12: _HTML_ENTITIES

 protected function _HTML_ENTITIES($elem)
 {
     return HTML::entities($elem[\Zeyon\SIGN_CDATA]);
 }
开发者ID:dapepe,项目名称:tymio,代码行数:4,代码来源:ixml.inc.php

示例13: select

 /**
  * Returns a "<select></select>" box and selects the option matching the HTTP POST/GET data, or the value if the former is missing.
  *
  * @param string $name The <select> tag name.
  * @param array $options An associative array of options. The keys contain
  *     the captions while the array elements contain the values. You can
  *     define an option group ("<optgroup>") by specifying an array of
  *     options as the value. For options with additional XHTML attributes,
  *     specify an array with the option value as the very first element and
  *     additional attributes thereafter.
  *     Example:
  *     <code>
  *         select('pizza', array(
  *             'Regular' => array(
  *                 'Margherita'    => array('margherita', 'title' => '50% Off Special'),
  *                 'Funghi'        => 'funghi',
  *                 'Prosciutto'    => 'prosciutto',
  *                 'Salame'        => 'salame',
  *             ),
  *             'Specials' => array(
  *                 'Mexican Style' => 'mexican',
  *                 'Spicy Curry'   => 'curry',
  *             ),
  *         ));
  *     </code>
  * @param mixed $value Optional. The value to select if no matching HTTP
  *     POST/GET variable exists. Default is NULL.
  * @param array $attributes Optional. Additional attributes to include.
  *     You can use this e.g. to set a tag ID or to override the "type"
  *     attribute. Default is NULL.
  * @param string $method Optional. Default is {@link METHOD_POST}.
  * @return string
  * @uses expandOptions()
  */
 public static function select($name, array $options, $value = null, array $attributes = null, $method = self::METHOD_POST)
 {
     $selectedValue = $method == self::METHOD_POST ? HTTP::readPOST($name, $value) : HTTP::readGET($name, $value);
     return '<select name="' . HTML::entities($name) . '" ' . HTML::expandAttributes($attributes) . '>' . self::expandOptions($options, $selectedValue) . '</select>';
 }
开发者ID:dapepe,项目名称:tymio,代码行数:39,代码来源:form.php

示例14:

<div class="comment">
  <div class="header">
    <?php 
echo App::gravatar_for($comment->email);
?>
    <?php 
echo $comment->username;
?>
  </div>
  <div class="content">
    <?php 
echo HTML::entities($comment->content);
?>
  </div>
</div>
开发者ID:nshontz,项目名称:laravel-blog,代码行数:15,代码来源:show.php

示例15: e_array

 /**
  * Convert HTML characters to entities.
  *
  * The encoding specified in the application configuration file will be used.
  *
  * @param string[] $array
  *
  * @return string[]
  */
 function e_array($array)
 {
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             $array[$key] = e_array($value);
         } else {
             $array[$key] = HTML::entities($value);
         }
     }
     return $array;
 }
开发者ID:nukacode,项目名称:lumen-base,代码行数:20,代码来源:helpers.php


注:本文中的HTML::entities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。