Skip to content

Commit

Permalink
add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
zamronypj committed Sep 14, 2019
1 parent 73d44ac commit c60209d
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

(*!------------------------------------------------------------
* Fano Web Framework Skeleton Application (https://fanoframework.github.io)
*
* @link https://github.com/fanoframework/fano-app-middleware
* @copyright Copyright (c) 2018 Zamrony P. Juhara
* @license https://github.com/fanoframework/fano-app-middleware/blob/master/LICENSE (GPL 3.0)
*------------------------------------------------------------- *)
unit GuestBookViewValidatorFactory;

interface

uses
fano;

type

TGuestBookViewValidatorFactory = class(TFactory, IDependencyFactory)
public
function build(const container : IDependencyContainer) : IDependency; override;
end;

implementation

uses
sysutils;

function TGuestBookViewValidatorFactory.build(const container : IDependencyContainer) : IDependency;
begin
result := (TValidation.create(THashList.create()))
.addRule(
'id',
TCompositeValidator.create([
TRequiredValidator.create(),
TAlphaNumSpaceValidator.create(TRegex.create())
])
) as IDependency;
end;
end.

0 comments on commit c60209d

Please sign in to comment.