FileUpload::getError PHP Method

getError() public method

获取某一个错误信息
public getError ( $name = false )
    public function getError($name = false)
    {
        if (!$name) {
            return $this->getErrors();
        } elseif (isset($this->_errors[$name])) {
            return $this->_errors[$name];
        } else {
            return null;
        }
    }

Usage Example

Esempio n. 1
0
 public function testGetSetError()
 {
     $file = new FileUpload();
     $this->assertEquals(UPLOAD_ERR_OK, $file->getError(), 'Default is ERR_OK');
     $this->assertFalse($file->hasError(), 'ERR_OK is not an error');
     $this->assertEquals($file, $file->setError(UPLOAD_ERR_INI_SIZE), 'Fluent API');
     $this->assertEquals(UPLOAD_ERR_INI_SIZE, $file->getError());
     $this->assertTrue($file->hasError());
 }
All Usage Examples Of FileUpload::getError