Componette

Componette

orisai

orisai / nette-data-sources

Orisai Data Sources integration for Nette

download-cloud-line composer require orisai/nette-data-sources

Orisai
Nette Data Sources

Orisai Data Sources integration for Nette

📄 Check out our documentation.

💸 If you like Orisai, please make a donation. Thank you!

use Orisai\DataSources\DataSource;
use Orisai\DataSources\Exception\EncodingFailure;
use Orisai\DataSources\Exception\NotSupportedType;

try {
	$dataSource->encode('data', 'application/json' /* or just 'json' */); // json-encoded string
} catch (NotSupportedType $exception) {
	// Requested type is not supported
	$exception->getRequestedType(); // 'application/json'
	$exception->getSupportedTypes(); // content types or file extensions, depending on what was requested
} catch (EncodingFailure $exception) {
	// Encoding failed
}

No release at this moment. Try to create first one.

Componette Componette felix@nette.org