src/Ubiquity/controllers/crud/CRUDController.php
public function newModel($modal = "no") {
		if (URequest::isAjax ()) {
			$model = $this->model;
			$instance = new $model ();
			$instance->_new = true;
			$this->_edit ( $instance, $modal );
		} else {
			$this->jquery->execAtLast ( "$('.ui.button._new').trigger('click');" );
			$this->index ();
		}
	}
public function newModel($modal = "no") {
		if (URequest::isAjax ()) {
			$model = $this->model;
			$instance = new $model ();
			$instance->_new = true;
			$this->_edit ( $instance, $modal );
		} else {
			$this->jquery->execAtLast ( "$('.ui.button._new').trigger('click');" );
			$this->index ();
		}
	}
public function newModel ( $ modal = "no" ) { if ( URequest :: isAjax ( ) ) { $ model = $ this -> model ; $ instance = new $ model ( ) ; $ instance -> _new = true ; $ this -> _edit ( $ instance , $ modal ) ; } else { $ this -> jquery -> execAtLast ( "$('.ui.button._new').trigger('click');" ) ; $ this -> index ( ) ; } }
Adds a new instance and edits it

@param string $modal Accept "no" or "modal" for a modal dialog
Adds a new instance and edits it