Not a developer? Go to MovableType.com

Documentation

MT::App::CMS::cmssavefilter.$type

This callback is invoked just prior to saving an object and is typically used for validating form input submitted by the user. The callback can be targeted to a specific data type by modifying the value of $type with one of the registered MT::Objects or data types.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $app - a handle to the current MT::App::CMS object processing this request.

Return Value

None.

Example Handler

sub handler {
    my ($cb, $app) = @_;
    if ($app->param('some_form_input') !~ /^\d+$/) {
        return $cb->error("The field 'some form input' must be a numeric value.");
    }
}
Back