本文整理汇总了PHP中Html::chars方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::chars方法的具体用法?PHP Html::chars怎么用?PHP Html::chars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Html
的用法示例。
在下文中一共展示了Html::chars方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
public function action_index()
{
$view = View::factory('providerm');
$errors = array();
$where = '';
$post = array();
try {
//--------------------------------------
//-------CREATE VALIDATION RULE IF ANY--------
$val = Validate::factory($_POST)->filter(TRUE, 'trim')->filter('id', 'trim')->filter('name', 'trim');
//------------END RULE------------------
//--------------------------------------
//------CREATE AN ARRAY OF POSTED DATA NEEDED-----
if (isset($_POST['submit'])) {
$post['name'] = Html::chars($_POST['name']);
}
//-------------END ACCEPTING POSTED DATA----------------------
if (isset($_REQUEST['id'])) {
$where = Html::chars($_REQUEST['id']);
}
if (!isset($_POST["submit"])) {
if ($where != '') {
$post = $this->model->SelectById($where);
if (!is_array($post)) {
throw new Exception('Invalid data');
}
}
} elseif (isset($_POST['submit'])) {
//------------CHECK FOR ANY VALIDATION RULE AND VALIDATE--------
if (!$val->check()) {
$errors = $val->errors('event');
throw new Exception('');
}
//------------NO PRO! LETS GO THERE--------
if ($where == '') {
$this->model->save($post);
} else {
$post['id'] = $where;
$this->model->update($post);
}
Cookie::set('msg', 'yes');
//------------REGISTRATION SUCESSFUL. WHAT NEXT--------
$this->request->redirect("provider/index");
}
} catch (Exception $e) {
//------------ERROR SELE. DISPLAY ERROR--------
$errors[] = $e->getMessage();
}
$view->errors = $errors;
$view->post = $post;
//-------WHICH CAPTION SHOULD WE SHOW FOR OUR BUTTON. MULTILANGUAGE PLEASE--------
if ($where != '') {
$view->btName = $this->message['update'];
} else {
$view->btName = $this->message['submit'];
}
//------------OUR PRESENTATION PLEASE!--------
$this->template->content = $view;
}
示例2: get_xss_cleaned
public function get_xss_cleaned()
{
$cleaned = array();
foreach ($this->meta()->fields() as $field_id => $field) {
if ($field instanceof Jelly_Field_Relationship) {
continue;
}
$cleaned[$field_id] = Html::chars($this->get($field_id));
}
return (object) $cleaned;
}
示例3:
<div class="control-group">
<label class="control-label" for="name">Unit Name </label>
<div class="controls">
<input placeholder="name" type="text" id="name" value="<?php
if (isset($post['name'])) {
echo Html::chars($post['name']);
}
?>
" name="name" required/>
</div>
</div>
<div class="control-group">
<label> </label>
<div class="controls">
<input type="hidden" id="id" value="<?php
if (isset($_REQUEST['id'])) {
echo Html::chars($_REQUEST['id']);
}
?>
" name="id" />
<input type="submit" value="<?php
echo $btName;
?>
" name="submit" class="btn" />
</div>
</div>
</fieldset>
</form>
</div>
</div>
示例4: html_entity_decode
<textarea name="conditionondischarge" id="conditionondischarge" required="required"><?php
if (isset($treatmentcycle['conditionondischarge'])) {
echo html_entity_decode($treatmentcycle['conditionondischarge']);
}
?>
</textarea>
</div>
</div>
<!-- nextappointment -->
<div class="control-group">
<label class="control-label" for="nextappointment">Appointment for FollowUp</label>
<div class="controls">
<input placeholder="Next Appointment Date" type="text" id="date" value="<?php
if (isset($post['nextappointment'])) {
echo Html::chars($post['nextappointment']);
}
?>
" name="nextappointment" required data-date-format="yyyy-mm-dd" class="datepicker"/> </div>
</div>
<div class="control-group">
<label> </label>
<div class="controls">
<input type="submit" value="Submit" name="submit" class="btn btn-danger" />
</div>
</div>
</form>
</div>
</div>
示例5: is_object
if ($partial) {
?>
<?php
$partial->item = is_object($item) ? $item : (object) $item;
?>
<?php
echo $partial;
?>
<?php
} else {
?>
<?php
foreach ($item as $ik => $iv) {
?>
<td><?php
echo Html::chars($iv);
?>
</td>
<?php
}
?>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
示例6:
echo $s['name'];
?>
</option>
<?php
}
}
?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">Email</label>
<div class="controls">
<input placeholder="User Email" type="text" id="name" value="<?php
if (isset($post['email'])) {
echo Html::chars($post['email']);
}
?>
" name="email" required/>
</div>
</div>
<?php
if (isset($_REQUEST['id'])) {
?>
<div class="control-group">
<label> <input type="checkbox" name="update_password" value="1"/> Update Password</label>
</div>
<?php
}
?>
<div class="control-group">
示例7:
/* Copyright (C) Sourcemap 2011
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this
* program. If not, see <http://www.gnu.org/licenses/>.*/
?>
<td><?php
echo $item->id;
?>
</td>
<td><?php
echo Html::chars($item->created);
?>
</td>
<td><div class="map-thumb" style="width: 10%; float: left;">
<a href="view/<?php
echo $item->id;
?>
"><img class="medium" src="<?php
echo $item->static;
?>
" /></a>
</div>
示例8: action_changepass
public function action_changepass()
{
$view = View::factory('userchangepass');
$errors = array();
$where = '';
$post = array();
try {
//--------------------------------------
//-------CREATE VALIDATION RULE IF ANY--------
$val = Validate::factory($_POST)->filter(TRUE, 'trim')->rule('password', 'not_empty')->rule('oldpass', 'not_empty')->rule('cpass', 'not_empty');
//------------END RULE------------------
//--------------------------------------
//------CREATE AN ARRAY OF POSTED DATA NEEDED-----
if (isset($_POST['submit'])) {
if ($_POST["password"] == "") {
throw new Exception('Password cannot be blank');
}
if ($_POST["password"] != $_POST["cpass"]) {
throw new Exception('Password do not match');
}
$post['password'] = Html::chars($_POST['password']);
$post['id'] = '';
$oldpass = Auth::instance()->hash_password($_POST["cpass"]);
if (!Auth::instance()->check_password($_POST['oldpass'])) {
throw new Exception('The old password you entered is invalid');
}
}
//-------------END ACCEPTING POSTED DATA----------------------
if (!isset($_POST["submit"])) {
$post = $this->model->SelectById($this->user->id);
} elseif (isset($_POST['submit'])) {
//------------CHECK FOR ANY VALIDATION RULE AND VALIDATE--------
if (!$val->check()) {
$errors = $val->errors('event');
throw new Exception('');
}
//------------NO PRO! LETS GO THERE--------
$this->model->change_password($post['password'], $this->user->id);
Cookie::set('msg', $this->message['sucess_msg']);
//------------REGISTRATION SUCESSFUL. WHAT NEXT--------
$this->request->redirect("user/changepass");
}
} catch (Exception $e) {
//------------ERROR SELE. DISPLAY ERROR--------
$errors[] = $e->getMessage();
}
$view->errors = $errors;
$view->post = $post;
//-------WHICH CAPTION SHOULD WE SHOW FOR OUR BUTTON. MULTILANGUAGE PLEASE--------
$view->btName = $this->message['change'];
//------------OUR PRESENTATION PLEASE!--------
$this->template->content = $view;
}
示例9: action_register
public function action_register()
{
$view = View::factory('new_hmo');
$errors = array();
$where = '';
$post = array();
try {
//--------------------------------------
//-------CREATE VALIDATION RULE IF ANY--------
$val = Validate::factory($_POST)->filter(TRUE, 'trim')->rule('firstname', 'not_empty')->filter('middlename', 'trim')->rule('lastname', 'not_empty')->rule('email', 'not_empty')->rule('phoneno', 'trim')->rule('password', 'not_empty')->rule('address', 'not_empty')->rule('name', 'not_empty');
//------------END RULE------------------
//--------------------------------------
//------CREATE AN ARRAY OF POSTED DATA NEEDED-----
if (isset($_POST['submit'])) {
if ($_POST["password"] != $_POST["copassword"]) {
throw new Exception("Password does not match");
}
$post['name'] = Html::chars($_POST['name']);
$post['address'] = Html::chars($_POST['address']);
$post['phoneno'] = Html::chars($_POST['phoneno']);
$post['mobile'] = Html::chars($_POST['mobile']);
$post['firstname'] = Html::chars($_POST['firstname']);
$post['middlename'] = Html::chars($_POST['middlename']);
$post['lastname'] = Html::chars($_POST['lastname']);
$post['email'] = Html::chars($_POST['email']);
$post['status'] = 'disabled';
$post['password'] = Html::chars($_POST['password']);
$post['username'] = $post['email'];
}
if (isset($_POST['submit'])) {
//------------CHECK FOR ANY VALIDATION RULE AND VALIDATE--------
if (!$val->check()) {
$errors = $val->errors('event');
throw new Exception('');
}
//------------NO PRO! LETS GO THERE--------
if ($where == '') {
$user = Model::factory('usermd')->save($post, "hmo");
$this->model->save($post, $user->id);
}
$post['from'] = 'info@nhis.com';
$post['to'] = $post['email'];
$post['message'] = 'We like to confirm your account. Click here to';
$post['subject'] = 'HMO Account Registration';
Model::factory('messagemd')->SendEmail($post);
$this->request->redirect("hmo/register");
}
} catch (Exception $e) {
//------------ERROR SELE. DISPLAY ERROR--------
$errors[] = $e->getMessage();
}
$view->errors = $errors;
$view->post = $post;
//-------WHICH CAPTION SHOULD WE SHOW FOR OUR BUTTON. MULTILANGUAGE PLEASE--------
if ($where != '') {
$view->btName = $this->message['update'];
} else {
$view->btName = $this->message['submit'];
}
//------------OUR PRESENTATION PLEASE!--------
$this->template = $view;
}
示例10: action_others
public function action_others()
{
$view = View::factory("patient_others");
$patientid = $this->request->param("id");
$patient = Model::factory('patientmd')->GetPatient($patientid);
if (!is_array($patient)) {
$this->request->redirect("patient/search");
}
$view->patient = $patient;
$treatmentcycle = Model::factory('treatmentcyclemd')->getCurrent($patient['id']);
if (!is_array($treatmentcycle)) {
$this->request->redirect("treatmentcycle/index/" . $patient['id']);
}
/* if($treatmentcycle['refertodoctor']!=$this->user->id)
$this->request->redirect("index");
*/
$treatments = Model::factory('treatmentcyclemd')->GetTreatments($treatmentcycle['id']);
$errors = array();
$post = array();
try {
$val = Validate::factory($_POST)->filter(TRUE, 'trim');
//------------END RULE------------------
//--------------------------------------
//------CREATE AN ARRAY OF POSTED DATA NEEDED-----
if (isset($_POST['submit'])) {
$post['nextappointment'] = Html::chars($_POST['nextappointment']);
$post['clicnicinformation'] = Html::chars($_POST['clicnicinformation']);
$post['complications'] = Html::chars($_POST['complications']);
$post['surgicaloperations'] = Html::chars($_POST['surgicaloperations']);
$post['indicationforsurgery2'] = Html::chars($_POST['indicationforsurgery2']);
$post['conditionondischarge'] = Html::chars($_POST['conditionondischarge']);
$post['id'] = $treatmentcycle['id'];
}
if (isset($_POST['submit'])) {
Model::factory('treatmentcyclemd')->update_others($post);
Cookie::set('msg', 'yes');
//------------REGISTRATION SUCESSFUL. WHAT NEXT--------
$this->request->redirect("patient/others/" . $patientid);
}
} catch (Exception $e) {
//------------ERROR SELE. DISPLAY ERROR--------
$errors[] = $e->getMessage();
}
$view->errors = $errors;
$view->post = $post;
//-------WHICH CAPTION SHOULD WE SHOW FOR OUR BUTTON. MULTILANGUAGE PLEASE--------
$view->btName = $this->message['submit'];
//------------OUR PRESENTATION PLEASE!--------
$view->treatments = $treatments;
$view->treatmentcycle = $treatmentcycle;
$this->template->content = $view;
}
示例11: date
* program. If not, see <http://www.gnu.org/licenses/>.*/
?>
<td><?php
echo $item->apikey;
?>
</td>
<td><?php
echo $item->apisecret;
?>
</td>
<td><?php
echo date('r', $item->created);
?>
</td>
<td><?php
echo $item->id;
?>
</td>
<td><?php
echo $item->requests;
?>
</td>
<td><a href="admin/users/<?php
echo $item->user_id;
?>
"><?php
echo Html::chars($item->owner->username);
?>
</a></td>
示例12: attributes
/**
* Compiles an array of HTML attributes into an attribute string.
* Attributes will be sorted using Html::$attribute_order for consistency.
*
* <code>
* echo '<div'.Html::attributes($attrs).'>'.$content.'</div>';
* </code>
*
* @param array $attributes Attribute list
* @return string
*/
public static function attributes(array $attributes = null)
{
if (empty($attributes)) {
return '';
}
// Init var
$sorted = array();
foreach (Html::$attribute_order as $key) {
if (isset($attributes[$key])) {
// Add the attribute to the sorted list
$sorted[$key] = $attributes[$key];
}
}
// Combine the sorted attributes
$attributes = $sorted + $attributes;
$compiled = '';
foreach ($attributes as $key => $value) {
if ($value === NULL) {
// Skip attributes that have NULL values
continue;
}
if (is_int($key)) {
// Assume non-associative keys are mirrored attributes
$key = $value;
}
// Add the attribute value
$compiled .= ' ' . $key . '="' . Html::chars($value) . '"';
}
return $compiled;
}
示例13:
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this
* program. If not, see <http://www.gnu.org/licenses/>.*/
?>
<td><?php
echo $item->id;
?>
</td>
<td><?php
echo Html::chars($item->site);
?>
</a></td>
<td><?php
echo Html::chars($item->alias);
?>
</td>
<td><a href="admin/supplychains/<?php
echo $item->supplychain_id;
?>
"><?php
echo $item->supplychain_id;
?>
</td>
<form name="delete-alias" method="post" action="admin/aliases/<?php
echo $item->id;
?>
/delete_supplychain_alias">
<td><input type ="submit" value="delete" /></form></td>
示例14:
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this
* program. If not, see <http://www.gnu.org/licenses/>.*/
?>
<td><?php
echo $item->id;
?>
</td>
<td><a href="admin/users/<?php
echo $item->id;
?>
"><?php
echo Html::chars($item->username);
?>
</a></td>
<td><?php
echo Html::chars($item->email);
?>
</td>
<td><img width="32px" height="32px" src="<?php
echo Gravatar::avatar($item->email, 32);
?>
" /></td>
<form name="delete-users" method="post" action="admin/users/<?php
echo $item->id;
?>
/delete_user">
<td><input type ="submit" value="delete" /></form></td>
示例15:
<label class="control-label" for="password">Password </label>
<div class="controls">
<input type="password" id="name" value="<?php
if (isset($post['password'])) {
echo Html::chars($post['password']);
}
?>
" name="password" required/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="password">Confirm Password </label>
<div class="controls">
<input type="password" id="name" value="<?php
if (isset($post['copassword'])) {
echo Html::chars($post['copassword']);
}
?>
" name="copassword" required/>
</div>
</div>
<div class="control-group">
<label> </label>
<div class="controls">
<input type="submit" value="Register" name="submit" class="btn" />
</div>
</div>
</fieldset>
</form>
</div>