Ejemplo n.º 1
0
 static function upload($fileName, $destination)
 {
     if (isset($_FILES[$fileName])) {
         folder::create(dirname($destination));
         if (move_uploaded_file($_FILES[$fileName]['tmp_name'], $destination)) {
             PHPToolkit::getClass('FileInterface');
             return new FileInterface($destination);
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 public function form($action = '', $method = 'post', $enctType = '')
 {
     PHPToolkit::getClass('formInterface');
     $form = new formInterface(clone $this->fieldSet, $action, $method, $enctType);
     $form->clearValues();
     //TODO: find why values are left behind from previous operations (passed by reference).
     return $form;
 }
Ejemplo n.º 3
0
 static function loadValidator()
 {
     return PHPToolkit::loadCSS('form/validate.css') . PHPToolkit::loadJavascript('jquery/jquery.js') . PHPToolkit::loadJavascript('form/validate.js');
 }
Ejemplo n.º 4
0
 public function filter($where = NULL, $order = NULL, $limit = NULL, $override = false)
 {
     PHPToolkit::getClass('filter');
     $this->filter = new filter($where, $order, $limit, $override);
 }