Commit graph

13 commits

Author SHA1 Message Date
cdb2e952f5 Form fields clean-up
Added a FieldView interface which must be implemented by field
renderers. The form's main view will look for FieldView implementations
to determine how to render specific field types. The only exception are
hidden fields, which are handled separately.
2012-02-07 09:27:46 +01:00
47b759d993 Loader::Find()
Added a method to the loader which can find all sub-classes /
implementations of a class / interface. The method must be called with
at least one argument (the name of the class / interface to find
subclasses / implementations of).

By default Loader::Find() will look for 'extra' classes. However, it is
possible to specify something else (e.g. 'ctrl' for controllers) as the
second argument.

Finally, by default, only packages which have already been loaded when
the method is called are considered. Passing false as the 3rd argument
will cause packages to be loaded.
2012-02-07 09:22:25 +01:00
f1016b039f Fixed database query execution
When queries are repeated, a method was supposed to be called in order
to check for prepared queries. This method did not exist. Which did not
help.
2012-02-06 18:25:03 +01:00
a1d327d465 Form controllers improvement
Form controllers are now able to return something other than true or
null. Whatever is returned by the form controller will be passed on by
the form if it isn't a boolean.
2012-02-06 17:26:55 +01:00
c73baa8488 Redirection fix
Redirection worked fine as long as the server was using HTTP. HTTPS was
a different matter entirely. Location headers will now be sent with full
protocol, server name and port.
2012-02-06 15:06:16 +01:00
62a4d0a391 E-mail validator
Added an e-mail validator to the form package. The validator is really
primitive and will only accept a small subset of email addresses, but I
needed one *now*.
2012-02-06 00:10:24 +01:00
f80d739f5d String field validator supports empty strings
It is possible to create a field validator that will make an exception
from the minimal length if the string is empty. And by "make an
exception", I don't mean "throwing one".
2012-02-05 23:03:18 +01:00
b80ac7ee91 Added really basic error view
Added a terribly ugly view that displays errors (e.g. 404's). It may be
ugly but it's still better than a PHP exception.
2012-02-05 18:22:01 +01:00
c5e30e4cc3 Added "hub page" package
This package provides the HubPage class which can be used to create
pages that act as URL mappers.
2012-02-05 17:59:12 +01:00
dd87433f82 Internal loader function availability
One of the loader's internal methods has been renamed and made
available. This allows components to be loaded from e.g. arrays
directly.
2012-02-05 17:49:54 +01:00
29a026e71a Improved URL rewriting support
When this code was written, it did not include an internal URL mapper
and each page was loaded by a PHP script. The internal URL was a recent,
mostly unfinished addition.

Base URL is now supported:
 * for views, when they implement the BaseURLAware interface (a base
class that does what most views will do with that is provided -
BaseURLAwareView),
 * in the menu,
 * in form actions,
 * in boxes (for buttons, and for the contents if the inner view
implements BaseURLAware).
2012-02-05 17:42:53 +01:00
3b91a6fc8c Multiple paths for configuration and packages
Added Loader::AddPath() which allows additional paths to be added to
the list in which the loader tries to find both configuration files
and components.
2012-02-05 13:58:55 +01:00
871d28cd16 Importing bits and pieces
This is the initial import based on a few files I had around.
2012-02-05 12:56:54 +01:00