Function: render-form


Saves continuation then renders form.


(defun render-form (k-id k template form-name &rest form-args)
  "Saves continuation then renders form."
  ;; responsible for setting up the continuation, and registering the handler as the callback.
  (let (#+(or)(session (get-session))
	  (form (get-wisp-form form-name)))
    (save-form-k k-id k
		 (apply #'curry (handler-fn form) k-id form-args)) 
    (if template
	(let ((form-html
	       (with-output-to-string (*form-html-string*)
		 (with-foo-output (*form-html-string*)
		   (apply (html-fn form) k-id form-args)))))
	  ;; insert the html (as string) for the form inside the provided template.
	  (render-html (funcall template form-html)))
	(render-html (apply (html-fn form) k-id form-args)))))
Source Context