namespace Cubist\Backpack\Magic;
+use Illuminate\Support\Facades\Http;
+
class Form extends SubForm
{
+ protected $_action = '';
+ protected $_method = "post";
+ protected $_enctype = 'application/x-www-form-urlencoded';
+ protected $_csrf = true;
+ protected $_title = '';
+
+
+ public function __construct($action = '', $method = 'post')
+ {
+ $this->setAction($action);
+ $this->setMethod($method);
+ parent::__construct();
+ }
+
+ /**
+ * @return string
+ */
+
public function render()
{
+ return view('form.form', ['form' => $this]);
+ }
+
+ public function __toString()
+ {
+ return $this->render();
+ }
+
+ /**
+ * @return string
+ */
+ public function getAction(): string
+ {
+ return $this->_action;
+ }
+
+ /**
+ * @param string $action
+ */
+ public function setAction(string $action): void
+ {
+ $this->_action = $action;
+ }
+
+ /**
+ * @return string
+ */
+ public function getEnctype(): string
+ {
+ return $this->_enctype;
+ }
+ /**
+ * @param string $enctype
+ */
+ public function setEnctype(string $enctype): void
+ {
+ $this->_enctype = $enctype;
+ }
+
+ /**
+ * @return string
+ */
+ public function getMethod(): string
+ {
+ return $this->_method;
+ }
+
+ /**
+ * @param string $method
+ */
+ public function setMethod(string $method): void
+ {
+ $this->_method = $method;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isCsrf(): bool
+ {
+ return $this->_csrf;
+ }
+
+ /**
+ * @param bool $csrf
+ */
+ public function setCsrf(bool $csrf): void
+ {
+ $this->_csrf = $csrf;
+ }
+
+ /**
+ * @param string $title
+ */
+ public function setTitle(string $title): void
+ {
+ $this->_title = $title;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTitle(): string
+ {
+ return $this->_title;
}
}