static public function fromObject($obj=null, callable $callback, array $options=[]){
		$form = static::createInstance(get_class($obj), $callback);
		$form->setNamePattern($obj);
		$form->parseOptions($options);
		$form->createResource($obj);
		$form->addClass(get_class($obj));

		$object_id = $form->res->getId();
		if ( $object_id !== false ){
			/* use a unique html id if the object has an id, makes it possible to use form for multiple objects of same type */
			$form->setId($form->id . "_{$object_id}");

			/* automatically add a hidden with the object id */
			$form->hiddenField("id");
		}

		$form->render();
	}