Пример #1
0
 /**
  * Get the form information and set it to the class properties
  * @return void
  * @throws PPI_Exception
  */
 function setFormData()
 {
     $aFormData = $this->getList('name = ' . $this->quote($this->_formName));
     ppi_dump($aFormData);
     exit;
     if (count($aFormData) > 0) {
         $aFormData = $aFormData[0];
         $this->_storageTable = $aFormData['table'];
         $this->_description = $aFormData['description'];
         $this->_submitText = $aFormData['submit_text'];
         $this->_formID = $aFormData['id'];
     } else {
         throw new PPI_Exception('Form: ' . $this->_formName . ' doesn\'t exist');
     }
 }
Пример #2
0
 /**
  * Get the routes, either from the cache or newly from disk
  *
  * @return array
  */
 function getRoute()
 {
     $this->routes = file_get_contents(APPFOLDER . 'Config/routes.php');
     ppi_dump($this->routes, true);
     // Loop through the route array looking for wild-cards
     foreach ($this->routes as $key => $val) {
         // Convert wild-cards to RegEx
         $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
         // Does the RegEx match?
         if (preg_match('#^' . $key . '$#', $uri)) {
             // Do we have a back-reference?
             if (strpos($val, '$') !== FALSE and strpos($key, '(') !== FALSE) {
                 $val = preg_replace('#^' . $key . '$#', $val, $uri);
             }
             $this->_set_request(explode('/', $val));
             return;
         }
     }
     PPI_Helper::getRegistry()->set();
     return self::$_routes;
 }