當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。