本文整理汇总了PHP中FormField::get_value方法的典型用法代码示例。如果您正苦于以下问题:PHP FormField::get_value方法的具体用法?PHP FormField::get_value怎么用?PHP FormField::get_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormField
的用法示例。
在下文中一共展示了FormField::get_value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_exists
public function user_exists(FormField $field)
{
if ($field->get_value()) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER, 'WHERE display_name=:display_name', array('display_name' => $field->get_value()));
}
return false;
}
示例2: login_exists
public function login_exists(FormField $field)
{
if (!empty($this->user_id)) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_INTERNAL_AUTHENTICATION, 'WHERE login=:login AND user_id != :user_id', array('login' => $field->get_value(), 'user_id' => $this->user_id));
} else {
if ($field->get_value()) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_INTERNAL_AUTHENTICATION, 'WHERE login=:login', array('login' => $field->get_value()));
}
}
return false;
}
示例3: validate
public function validate()
{
$first_value = $this->first_field->get_value();
$second_value = $this->second_field->get_value();
if ($first_value !== null && $second_value !== null) {
if ($first_value == $second_value) {
return true;
}
}
return false;
}
示例4: email_exists
public function email_exists(FormField $field)
{
if (!empty($this->user_id)) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER, 'WHERE email=:email AND user_id != :user_id', array('email' => $field->get_value(), 'user_id' => $this->user_id));
} else {
if ($field->get_value()) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER, 'WHERE email=:email', array('email' => $field->get_value()));
}
}
return false;
}
示例5: display_name_exists
public function display_name_exists(FormField $field)
{
if (!empty($this->user_id)) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER, 'WHERE display_name=:display_name AND user_id != :user_id', array('display_name' => $field->get_value(), 'user_id' => $this->user_id));
} else {
if ($field->get_value()) {
return PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER, 'WHERE display_name=:display_name', array('display_name' => $field->get_value()));
}
}
return false;
}
示例6: validate
public function validate()
{
$first_value = $this->first_field->get_value();
$second_value = $this->second_field->get_value();
if ($first_value !== null && $second_value !== null) {
if ($first_value instanceof Date && $second_value instanceof Date) {
if ($second_value->get_timestamp() > $first_value->get_timestamp()) {
return true;
}
} else {
if ($second_value > $first_value) {
return true;
}
}
}
return false;
}
示例7: validate
public function validate(FormField $field)
{
$value = strlen($field->get_value());
$is_required = $field->is_required();
if (!empty($value) || $is_required) {
return $value >= $this->lower_bound && $value <= $this->upper_bound;
}
return true;
}
示例8: url_is_valid
public function url_is_valid(FormField $field)
{
$status = 200;
$url = new Url($field->get_value());
$file_headers = get_headers($url->absolute(), true);
if (is_array($file_headers)) {
if (preg_match('/^HTTP\\/[12]\\.[01] (\\d\\d\\d)/', $file_headers[0], $matches)) {
$status = (int) $matches[1];
}
}
return $status == 200;
}
示例9: validate
public function validate(FormField $field)
{
$value = $field->get_value();
$is_required = $field->is_required();
if ($value instanceof Date) {
$value = $value->format(Date::FORMAT_ISO_DAY_MONTH_YEAR);
}
if (!empty($value) || $is_required) {
return preg_match($this->php_regex, $value) > 0;
}
return true;
}
示例10: validate
public function validate(FormField $field)
{
$value = $field->get_value();
$this->set_validation_error_message(StringVars::replace_vars($this->error_message, array('name' => strtolower($field->get_label()))));
if ($value instanceof FormFieldEnumOption) {
return $value->get_raw_value() !== null && $value->get_raw_value() != '';
}
if ($value instanceof Date) {
return $value->format(Date::FORMAT_ISO_DAY_MONTH_YEAR) !== null && $value->format(Date::FORMAT_ISO_DAY_MONTH_YEAR) != '';
}
return $value == 0 || $value !== null && $value != '';
}
示例11: validate
public function validate(FormField $field)
{
$is_required = $field->is_required();
$value = $field->get_value();
if (!is_numeric($value)) {
return false;
}
$value = (int) $value;
if (!empty($value) || $is_required) {
return $value <= $this->upper_bound;
}
return true;
}
示例12: validate
public function validate(FormField $field)
{
$value = $field->get_value();
if (empty($value)) {
return false;
}
if (file_exists($value)) {
$value = substr($value, -1) == '/' ? $value : $value . '/';
if (file_exists($value . 'wp-config.php')) {
require_once $value . 'wp-config.php';
if (defined('DB_HOST')) {
return true;
}
}
}
return false;
}
示例13: validate
public function validate(FormField $field)
{
$field_name = ContactField::rewrite_field_name($field->get_value());
$valid = true;
if (!empty($this->field_id)) {
foreach (ContactConfig::load()->get_fields() as $id => $f) {
if ($id != $this->field_id && $f['field_name'] == $field_name) {
$valid = false;
}
}
} else {
foreach (ContactConfig::load()->get_fields() as $id => $f) {
if ($f['field_name'] == $field_name) {
$valid = false;
}
}
}
return $valid;
}
示例14: warning_if_not_equals
private function warning_if_not_equals(FormField $field, $message)
{
$tpl = new StringTemplate('var field = $FF(${escapejs(ID)});
var value = ${escapejs(VALUE)};
if (field.getValue()!=value && !confirm(${escapejs(MESSAGE)})){field.setValue(value);}');
$tpl->put('ID', $field->get_id());
$tpl->put('VALUE', $field->get_value());
$tpl->put('MESSAGE', $message);
return $tpl->render();
}
示例15: get_value
protected function get_value()
{
return $this->field->get_value();
}