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


PHP Input::exists方法代码示例

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


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

示例1: RequesracallAction

    public function RequesracallAction()
    {
        if (Input::exists() && Token::check(Input::get('token'))) {
            $this->_DB->insert('phones', array('id' => 0, 'name' => Input::get('name'), 'number' => Input::get('number')));
            $this->registerAction();
        }
        ?>
<form action="" method="post">
    <div class="field">
        <LABEL for="name">Name: </LABEL>
        <input
            type="text"
            name="name"
            id="name" />
    </div>
    <div class="field">
        <label for="number">Number: </label>
        <input
            type="tel"
            name="number"
            id="number" />
    </div>
    <input type="hidden" name="token" value="<?php 
        echo Token::generate();
        ?>
" />
    <input type="submit" value="Save"/>
</form>
        <?php 
    }
开发者ID:ITESolutions,项目名称:desktop,代码行数:30,代码来源:index.php

示例2: install

 public function install()
 {
     if (Request::isMethod('post')) {
         $step = Session::get('step');
         $inputs = Input::all();
         foreach ($inputs as $key => $value) {
             Session::put($key, $value);
         }
         if (Input::exists('back')) {
             $step--;
         } else {
             $step++;
         }
         Session::put('step', $step);
         if ($step < 7) {
             return Redirect::to("/install?step=" . $step);
         } else {
             return Redirect::to("/install/complete");
         }
     } else {
         $step = Input::get('step') ? Input::get('step') : 1;
         Session::put('step', $step);
         return View::make("installer.step" . $step);
     }
 }
开发者ID:felipemarques8,项目名称:goentregas,代码行数:25,代码来源:InstallerController.php

示例3: send

 public function send()
 {
     $out = '';
     if (Input::exists("post")) {
         $this->subject = Input::method("POST", "s");
         $this->name = Input::method("POST", "n");
         $this->email = Input::method("POST", "e");
         $this->message = Input::method("POST", "m");
         $this->lang = Input::method("POST", "l");
         $this->ip = get_ip::ip();
         $_SESSION["send_view"] = isset($_SESSION["send_view"]) ? $_SESSION["send_view"] + 1 : 1;
         if ($_SESSION["send_view"] > 150) {
             if ($this->lang == "en") {
                 $out = '<font color="red">Error !</font>';
             } else {
                 $out = '<font color="red">მოხდა შეცდომა !</font>';
             }
             exit;
         }
         // echo $this->email;
         if (empty($this->subject) || empty($this->name) || empty($this->email) || empty($this->message) || empty($this->lang)) {
             if ($this->lang == "en") {
                 $out = '<font color="red">All field are required !</font>';
             } else {
                 $out = '<font color="red">ყველა ველის შევსება სავალდებულოა !</font>';
             }
         } else {
             if (!$this->isValidEmail($this->email)) {
                 if ($this->lang == "en") {
                     $out = '<font color="red">Email is not valid !</font>';
                 } else {
                     $out = '<font color="red">გთხოვთ გადაამოწმოთ ელ-ფოსტის ველი !</font>';
                 }
             } else {
                 $i = $this->selectEmailGeneralInfo();
                 $message = wordwrap(strip_tags($this->message), 70, "\r\n");
                 $message .= '<br />Sender IP: ' . $this->ip;
                 $headers = 'MIME-Version: 1.0' . "\r\n";
                 $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
                 $headers .= 'To: ' . $i["fromname"] . ' <' . $i["from"] . '>' . "\r\n";
                 $headers .= 'From: ' . $this->name . ' <' . $this->email . '>' . "\r\n";
                 $send_email = mail($to, $this->subject, $message, $headers);
                 if ($send_email) {
                     if ($this->lang == "en") {
                         $out = '<font color="green">Message sent !</font>';
                     } else {
                         $out = '<font color="green">შეტყობინება გაგზავნილია !</font>';
                     }
                 } else {
                     if ($this->lang == "en") {
                         $out = '<font color="red">Error !</font>';
                     } else {
                         $out = '<font color="red">მოხდა შეცდომა !</font>';
                     }
                 }
             }
         }
     }
     echo $out;
 }
开发者ID:studio-404,项目名称:geda,代码行数:60,代码来源:sendemail.php

示例4: initialize

 /**
  * Initializes the session system.
  */
 private static function initialize()
 {
     // Make sure it's not initialized already
     if (self::$initialized) {
         return;
     }
     // See if we were given a session id explicitly
     // If so we also need a matching token to allow it
     $setSid = false;
     if (Input::exists('_sid')) {
         session_id(Input::get('_sid'));
         $setSid = true;
     }
     // Start the default PHP session
     self::$prefix = crc32(APP_SALT) . '_';
     session_name('session');
     session_start();
     // Set the initialized flag
     self::$initialized = true;
     // Make sure the token is good before we allow
     // explicit session id setting
     if ($setSid) {
         Auth::checkToken();
     }
 }
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:28,代码来源:session.php

示例5: login

 public function login($id = null)
 {
     $user = $this->user;
     $this->data['user']['name'] = $user->data()->user;
     Config::set('html.title', 'Авторизация');
     Config::set('html.description.val', 'На этой странице можно залогиниться');
     //$user = new User();
     $salt = uniqid();
     if (!Session::exists(Config::get('session.token_name'))) {
         Token::generate();
     }
     if (Input::exists()) {
         if (Token::check(Input::get('token'))) {
             $validate = new VALIDATE();
             $validation = $validate->check($_POST, array('user' => array('required' => true), 'password' => array('required' => true)));
             if ($validate->passed()) {
                 $remember = Input::get('remember') === 'on' ? true : false;
                 $login = $user->login(Input::get('user'), Input::get('password'), null);
                 if ($login) {
                     Redirect::to('/');
                 } else {
                     echo '<p>Sorry, logging in failed</p>';
                 }
             } else {
                 foreach ($validation->errors() as $error) {
                     //echo $error, '<br/>';
                     $this->data['validate_errors'][] = $error;
                 }
             }
         }
     }
     //$this->data['id']=$id;
     //$this->data['name']=Input::get('name');
     $this->view('user/login');
 }
开发者ID:nanofelix,项目名称:sample-app,代码行数:35,代码来源:user.php

示例6: cadastra

 /**
  * @todo Sanitizar entrada de dados
  */
 public function cadastra()
 {
     if (Input::exists()) {
         $pessoaJuridicaTelefone = $this->setDados();
         try {
             $telefone = $this->model->gravar($pessoaJuridicaTelefone);
         } catch (Exception $e) {
             CodeFail((int) $e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
         }
         $return['fone'] = $telefone->getFone();
         foreach ($this->operadoras as $catg_tel) {
             if ($catg_tel->getCdVlCategoria() == $telefone->getCdVlCatgOperadora()) {
                 $return['operadora'] = $catg_tel->getDescVlCatg();
             }
         }
         foreach ($this->categorias as $pj_tel) {
             if ($pj_tel->getCdVlCategoria() == $telefone->getCdVlCatgFonePj()) {
                 $return['categoria'] = $pj_tel->getDescVlCatg();
             }
         }
         $return['observacao'] = $telefone->getObservacao();
         $return['cd_pj_fone'] = $telefone->getCdPjFone();
         echo json_encode($return);
     }
 }
开发者ID:dnaCRM,项目名称:dnaCRM,代码行数:28,代码来源:PessoaJuridicaTelefone.php

示例7: getValue

 public function getValue()
 {
     parent::getValue();
     if (\Request::isMethod('post') && !\Input::exists($this->name)) {
         $this->value = $this->unchecked_value;
     }
     $this->checked = (bool) ($this->value == $this->checked_value);
 }
开发者ID:maxmirazh33,项目名称:rapyd-laravel,代码行数:8,代码来源:Checkbox.php

示例8: getNewValue

 public function getNewValue()
 {
     $process = \Input::get('search') || \Input::get('save') ? true : false;
     if ($process && \Input::exists($this->lat)) {
         $this->new_value['lat'] = \Input::get($this->lat);
         $this->new_value['lon'] = \Input::get($this->lon);
     }
 }
开发者ID:chellmann,项目名称:rapyd-laravel,代码行数:8,代码来源:Map.php

示例9: uploadFoto

 /**
  * Método para manipulação da foto do perfil
  * Este método utiliza uma classe externa que não foi criada por mim
  */
 public function uploadFoto()
 {
     if (Input::exists('files')) {
         $fotoperfil = isset($_FILES[$this->coluna]) ? $_FILES[$this->coluna] : null;
         if ($fotoperfil['error'] > 0) {
             echo 'Nenhuma imagem enviada.<br>';
         } else {
             // array com extensões válidas
             $validExtensions = array('.jpg', '.jpeg');
             // pega a extensão do arquivo enviado
             $fileExtension = strrchr($fotoperfil['name'], ".");
             // testa se extensão é permitida
             if (in_array($fileExtension, $validExtensions)) {
                 $manipulator = new ImageManipulator($fotoperfil['tmp_name']);
                 // o tamanho da imagem poderia ser 800x600
                 $width = $manipulator->getWidth();
                 $height = $manipulator->getHeight();
                 // Encontrando o centro da imagem
                 $centreX = round($width / 2);
                 // 400
                 $centreY = round($height / 2);
                 //300
                 // Define canto esquerdo de cima
                 if ($width > $height) {
                     // Parâmetros caso a imagem fornecida seja no formato paisagem
                     $x1 = $centreX - $centreY;
                     // 400 - 300 = 100 "Topo esquerdo X"
                     $y1 = 0;
                     // "Topo esquerdo Y"
                     // Define canto direito de baixo
                     $x2 = $centreX + $centreY;
                     // 400 + 300 = 700 / 2 "Base X"
                     $y2 = $centreY * 2;
                     // 300 * 2 = 600 "Base Y"
                 } else {
                     // Parâmetros caso a imagem não seja no formato paisagem
                     $y1 = $centreY - $centreX;
                     // 400 - 300 = 100 "Topo esquerdo X"
                     $x1 = 0;
                     // "Topo esquerdo Y"
                     // Define canto direito de baixo
                     $y2 = $centreX + $centreY;
                     // 400 + 300 = 700 / 2 "Base X"
                     $x2 = $centreX * 2;
                     // 300 * 2 = 600 "Base Y"
                 }
                 // corta no centro  200x200
                 $manipulator->crop($x1, $y1, $x2, $y2);
                 // redimensiona a imagem para 400x400
                 $manipulator->resample(400, 400, true);
                 $manipulator->save(IMG_UPLOADS_FOLDER . $this->arquivo_temp);
                 $this->foto_enviada = true;
             } else {
                 $this->foto_enviada = false;
             }
         }
     }
 }
开发者ID:dnaCRM,项目名称:dnaCRM,代码行数:62,代码来源:ImageModel.php

示例10: index

 public function index()
 {
     if (\Input::exists('query')) {
         $projects = $this->service->searchProjects(Input::get('query'));
     } else {
         $projects = $this->service->getProjects(\Authorization::user());
     }
     return $this->returnProjectModels($projects);
 }
开发者ID:HOFB,项目名称:HOFB,代码行数:9,代码来源:ProjectController.php

示例11: request

 public function request()
 {
     if (Input::exists()) {
         if (Input::get('del_relacao') != 's') {
             $this->cadastra();
         } else {
             $this->apagar();
         }
     }
 }
开发者ID:dnaCRM,项目名称:dnaCRM,代码行数:10,代码来源:RelacionamentoParametro.php

示例12: cssClass

 public static function cssClass($field, array $erros)
 {
     if (Input::exists()) {
         if (in_array($field, $erros)) {
             return 'has-error';
         } else {
             return 'has-success';
         }
     }
     return '';
 }
开发者ID:dnaCRM,项目名称:dnaCRM,代码行数:11,代码来源:Validate.php

示例13: salvarUsuario

 /**
  * Registra um usuário com dados recebidos do formulário
  *
  */
 public function salvarUsuario($id = null)
 {
     if (Input::exists()) {
         if (Token::check(Input::get('token'))) {
             $usuario = $this->setDados();
             if ($this->getModel()->findByLogin($usuario)) {
                 $this->atualizar = true;
             }
             $msg = $this->getModel()->gravar($usuario, $this->atualizar);
             Session::flash('msg', $msg['fc_criar_usuario'], 'success');
         }
     }
 }
开发者ID:dnaCRM,项目名称:dnaCRM,代码行数:17,代码来源:Usuario.php

示例14: cadastra

 public function cadastra()
 {
     if (Input::exists()) {
         $pessoaFisicaEndereco = $this->setDados();
         try {
             $endereco = $this->model->gravar($pessoaFisicaEndereco);
         } catch (Exception $e) {
             CodeFail((int) $e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
         }
         $return = $this->pessoaFisicaEnderecoModel->setDTO($endereco)->getArrayDados();
         echo json_encode($return);
     }
 }
开发者ID:dnaCRM,项目名称:dnaCRM,代码行数:13,代码来源:PessoaFisicaEndereco.php

示例15: run

 public function run()
 {
     if (Input::exists('post')) {
         //check if form loaded propely
         if (Token::check(Input::get('token'))) {
             echo $this->model->process();
         } else {
             return miscellaneous::Error();
         }
     } else {
         return miscellaneous::Error();
     }
 }
开发者ID:WWAHIDAADNAN,项目名称:JUSTAS,代码行数:13,代码来源:admissionform_controller.php


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