예제 #1
0
파일: Form.php 프로젝트: rad8329/cordillera
 /**
  * @param string $name
  *
  * @return string
  */
 public function field($name)
 {
     if (property_exists($this, $name)) {
         return Crypt::request((new \ReflectionClass($this))->getShortName()) . '[' . Crypt::request($name) . ']';
     }
     return Crypt::request($name);
 }
예제 #2
0
 /**
  * @return string
  */
 public function generateId()
 {
     return implode('-', str_split(strtoupper(Crypt::create(12)), 4));
 }
예제 #3
0
 /**
  * @param string $name
  * @param mixed  $default
  *
  * @return mixed
  */
 public function post($name, $default = null)
 {
     $parsed = explode('.', $name);
     $result = $_POST;
     while ($parsed) {
         $next = array_shift($parsed);
         $next_crypted = Crypt::request($next);
         if (isset($result[$next])) {
             $result = $result[$next];
         } elseif ($next_crypted != $next && isset($result[$next_crypted])) {
             $result = $result[$next_crypted];
         } else {
             return $default;
         }
     }
     return $result;
 }
예제 #4
0
 /**
  * @param string $id
  * @param string $data
  *
  * @return bool
  */
 public function write($id, $data)
 {
     return parent::write($id, mcrypt_encrypt(MCRYPT_3DES, Crypt::pad($this->_key), $data, MCRYPT_MODE_ECB));
 }