summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2009-04-05 16:33:21 +0200
committerfranck cuny <franck@lumberjaph.net>2009-04-05 16:33:21 +0200
commited4484c8dfc9c2a2e8619bbb0a75d7ebc91058e9 (patch)
tree8d7bcb74df584f57df6993cc1f74cd1d8a183cca
parentcleaning (diff)
downloadintention-cloud-ed4484c8dfc9c2a2e8619bbb0a75d7ebc91058e9.tar.gz
cloud controller
-rw-r--r--lib/intentioncloud/Controller/Cloud.pm42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/intentioncloud/Controller/Cloud.pm b/lib/intentioncloud/Controller/Cloud.pm
new file mode 100644
index 0000000..2d96e47
--- /dev/null
+++ b/lib/intentioncloud/Controller/Cloud.pm
@@ -0,0 +1,42 @@
+package intentioncloud::Controller::Cloud;
+
+use strict;
+use warnings;
+use parent 'Catalyst::Controller';
+
+sub search : Local {
+    my ( $self, $c ) = @_;
+    $c->stash->{ template } = 'cloud/cloud.tt';
+
+    $c->model( 'Search' )->search($c);
+}
+
+sub random : Local {
+    my ( $self, $c ) = @_;
+    $c->stash->{ template } = 'cloud/random.tt';
+
+    $c->stash( cloud => $c->model( 'DB::Search' )
+            ->find( {}, { order_by => [ 'random()' ] } ) );
+}
+
+1;
+
+=head1 NAME
+
+intentioncloud::Controller::Cloud - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+
+=head1 AUTHOR
+
+franck cuny,,,
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.