unit1.pas 604 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. unit Unit1;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. BrookAction;
  6. type
  7. { TAction1 }
  8. TAction1 = class(TBrookAction)
  9. public
  10. procedure Get; override;
  11. end;
  12. { TAction2 }
  13. TAction2 = class(TBrookAction)
  14. public
  15. procedure Get; override;
  16. end;
  17. implementation
  18. { TAction1 }
  19. procedure TAction1.Get;
  20. begin
  21. Write('TAction1 - Default.');
  22. end;
  23. { TAction2 }
  24. procedure TAction2.Get;
  25. begin
  26. Write('TAction2');
  27. end;
  28. initialization
  29. // the TAction1 is called by default when no action matches with informed URL
  30. TAction1.Register('/action1', True);
  31. TAction2.Register('/action2');
  32. end.