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


PHP v类代码示例

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


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

示例1: indexAction

 function indexAction()
 {
     if (isset($_POST['check'])) {
         if ($_POST['FORM']['ua'] == 'on') {
             $_POST['FORM']['ua'] = 1;
         } else {
             $_POST['FORM']['ua'] = 0;
         }
         if ($_POST['FORM']['en'] == 'on') {
             $_POST['FORM']['en'] = 1;
         } else {
             $_POST['FORM']['en'] = 0;
         }
         if ($_POST['FORM']['fr'] == 'on') {
             $_POST['FORM']['fr'] = 1;
         } else {
             $_POST['FORM']['fr'] = 0;
         }
         if ($_POST['FORM']['esp'] == 'on') {
             $_POST['FORM']['esp'] = 1;
         } else {
             $_POST['FORM']['esp'] = 0;
         }
         if ($_POST['FORM']['ger'] == 'on') {
             $_POST['FORM']['ger'] = 1;
         } else {
             $_POST['FORM']['ger'] = 0;
         }
         forms::multy_update_form($this->tablename, 1, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     $sql = "SELECT * FROM languages";
     $res = mysql::query_one($sql, 0);
     return system::show_tpl(array('obj' => $res, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/index.php');
 }
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:35,代码来源:languagesController.php

示例2: postTransfer

 public function postTransfer()
 {
     try {
         if ($this->app->session->phrase != $this->app->request->post("captcha")) {
             throw new InvalidCustomException("Captcha yang anda masukan salah");
         }
         $member_from = $this->app->em->find("Mabes\\Entity\\Member", $this->app->request->post("login_from"));
         $member_to = $this->app->em->find("Mabes\\Entity\\Member", $this->app->request->post("login_to"));
         v::object()->assert($member_from);
         v::object()->assert($member_to);
         $transfer = new Transfer();
         $transfer->massAssignment($this->app->request->post());
         $transfer->setFromLogin($member_from);
         $transfer->setToLogin($member_to);
         $this->app->em->persist($transfer);
         $this->app->em->flush();
         $this->app->view()->appendData(["isSuccess" => true, "successTitle" => "Success", "successMessage" => "Transfer Request anda sudah kami terima"]);
     } catch (AbstractNestedException $e) {
         $errors = $e->findMessages(["numeric" => "{{name}} harus berisi numeric", "alnum" => "{{name}} harus berisi alphanumeric", "email" => "{{name}} harus berisi email yang valid", "float" => "{{name}} harus bernilai desimal", "notEmpty" => "Mohon diisi semua field", "equals" => "{{input}} tidak cocok dengan yang ada didatabase", "object" => "no login tidak dapat ditemukan didalam database", "startsWith" => "Nomor telepon harus berawalan dengan +", 'uploaded' => "file upload gagal"]);
         $this->validationMessage($errors);
     } catch (InvalidCustomException $e) {
         $this->validationMessage(["custom" => $e->getMessage()]);
     }
     $this->app->render('Pages/_transferBalance.twig');
 }
开发者ID:semplon,项目名称:mabes,代码行数:25,代码来源:TransferController.php

示例3: port

 /**
  * Returns the port for the given url
  *
  * @return mixed
  */
 public static function port($url = null)
 {
     if (is_null($url)) {
         $url = static::current();
     }
     $port = intval(parse_url($url, PHP_URL_PORT));
     return v::between($port, 1, 65535) ? $port : false;
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:13,代码来源:url.php

示例4: deleteAction

 /**
  * delete podrasdel
  */
 function deleteAction()
 {
     $this->msg = general::messages(1, v::getI18n('backend_after_delete'));
     // удаляем из таблицы Content
     $_sql = 'DELETE FROM `' . $this->tablename . '` WHERE (`id`="' . $_GET['id'] . '")';
     $result = mysql::just_query($_sql, 0);
     return self::indexAction();
 }
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:11,代码来源:votingController.php

示例5: extractAddress

 /**
  * Extracts the email address from an address string
  *
  * @return string
  */
 protected function extractAddress($string)
 {
     if (v::email($string)) {
         return $string;
     }
     preg_match('/<(.*?)>/i', $string, $array);
     return empty($array[1]) ? $string : $array[1];
 }
开发者ID:biggtfish,项目名称:Clean-Blog-Kirby-Theme,代码行数:13,代码来源:email.php

示例6: validaCaptcha

 protected function validaCaptcha()
 {
     $captcha = f::request('post', 'normal', f::id('captcha'));
     if (str_replace(' ', '', strtolower($captcha)) != str_replace(' ', '', strtolower(f::getSession('captcha')))) {
         v::setError('El código de la imágen no es válido.');
     } else {
         f::setSession('captcha', Cifrar::random(10));
     }
 }
开发者ID:eddyn73,项目名称:SURP,代码行数:9,代码来源:BL.php

示例7: validate

 public function validate()
 {
     $result = $this->result();
     if (empty($result)) {
         return !$this->required();
     } else {
         return v::date($result);
     }
 }
开发者ID:v1m0,项目名称:kirby-f6,代码行数:9,代码来源:datetime.php

示例8: logoff

 public function logoff()
 {
     f::setSession('idUsuario', null);
     f::setSession('nombre', null);
     v::setTrueJSON();
     v::setJSON('tag', 'body');
     v::setJSON('ubicacion', 'up');
     v::setJSON('descripcion', c::getViewSystem('modulos/login/index.php', false));
     v::printJSON();
 }
开发者ID:eddyn73,项目名称:SURP,代码行数:10,代码来源:BL_Login.php

示例9: field

 public function field($key, $field = null)
 {
     if (is_null($field)) {
         $field = $key;
     }
     $value = a::get($this->data, $field);
     if ($key == 'url' and !v::url($value)) {
         $value = null;
     }
     $this->{$key} = new Field($this->page, $key, esc($value));
 }
开发者ID:aizlewood,项目名称:2016,代码行数:11,代码来源:mention.php

示例10: connect

 /**
  * 	connect to database
  *	@param  none
  */
 static function connect()
 {
     global $dbname;
     global $hostname;
     global $username;
     global $password;
     //mysql_connect(v::getConfig('db/host'), v::getConfig('db/user'), v::getConfig('db/password')) or
     //die(v::getI18n('mysql_connect_faild'));
     mysql_connect($hostname, $username, $password) or die(v::getI18n('mysql_connect_faild'));
     $result = mysql_db_query($dbname, "SET CHARACTER SET utf8");
 }
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:15,代码来源:mysql.class.php

示例11: addAction

 /**
  * добавляем новый материал
  */
 function addAction()
 {
     $this->table_name = $_GET['tablename'];
     if ($_POST) {
         // проверяем на checkbox
         forms::check_box(array('status'));
         // записываем в базу
         forms::multy_insert_form($this->table_name, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     return system::show_tpl(array('msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
 }
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:15,代码来源:onelevelController.php

示例12: validate

 public function validate()
 {
     if (!v::num($this->result())) {
         return false;
     }
     if ($this->min and !v::min($this->result(), $this->min)) {
         return false;
     }
     if ($this->max and !v::max($this->result(), $this->max)) {
         return false;
     }
     return true;
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:13,代码来源:number.php

示例13: editAction

 /**
  * редактирование настроек
  */
 function editAction()
 {
     if ($_POST) {
         // записываем в базу
         forms::multy_update_form_all_records($this->tablename, 'zna', 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where status=1 order by sort';
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/edit.php');
 }
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:16,代码来源:configController.php

示例14: editAction

 /**
  * редактируем материал
  */
 function editAction()
 {
     if ($_POST) {
         // записываем в базу
         forms::multy_update_form($this->tablename, $_POST['id'], 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
         $_sql = 'SELECT * FROM ' . $this->tablename . ' where id=' . $_POST['id'];
     } else {
         $_sql = 'SELECT * FROM ' . $this->tablename . ' where id=' . $_GET['id'];
     }
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query_one($_sql, 0);
     return system::show_tpl(array('obj' => $result, 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/edit.php');
 }
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:17,代码来源:seoController.php

示例15: validate

 public function validate()
 {
     if ($this->validate and is_array($this->validate)) {
         return parent::validate();
     } else {
         if ($this->min and !v::min($this->result(), $this->min)) {
             return false;
         }
         if ($this->max and !v::max($this->result(), $this->max)) {
             return false;
         }
     }
     return true;
 }
开发者ID:madebypost,项目名称:Gulp-Neat-KirbyCMS,代码行数:14,代码来源:text.php


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