File "Response.php"
Full Path: /home/romayxjt/public_html/wp-content/plugins/fluentform/vendor/wpfluent/framework/src/WPFluent/Response/Response.php
File size: 646 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
namespace FluentForm\Framework\Response;
class Response
{
protected $app = null;
public function __construct($app)
{
$this->app = $app;
}
public function json($data = null, $code = 200)
{
return wp_send_json($data, $code);
}
public function send($data = null, $code = 200)
{
return new \WP_REST_Response($data, $code);
}
public function sendSuccess($data = null, $code = 200)
{
return new \WP_REST_Response($data, $code);
}
public function sendError($data = null, $code = 422)
{
return new \WP_REST_Response($data, $code);
}
}