I usually just do sth like:
if($result-have_errors) { display form; return }
# otherwise:
my $p = $c-req-params;
# We know that the params are valid now...
Mark
On Tuesday 26 December 2006 6:01 pm, Dennis Daupert wrote:
This is throwing me down the stairs. I'm trying to pull out individual
Hi there,
I'm basically wanting to write a simple log function which logs hits on my
website as entries in a database (automatically adding $c-user-{id} and
$c-req-referrer etc), but to do so I want to use a model (I think). Any
ideas how I can just say $c-model('Log')-info(foo) and
that's cos the database connection has gone away (it happens after about 20
min) and the DBD driver for you database doesnt have autoreconnect set. This
is a DBD:: specific thing - the way for mysql databases is to set
mysql_auto_reconnect to true in the DBI connection options (which iirc you
On Wednesday 27 December 2006 1:01 pm, Ash Berlin wrote:
Very very *VERY* bad idea.
__PACKAGE__-mk_accessors(context);
sub ACCEPT_CONTEXT {
my ($self, $c, @args) = @_;
my $new = bless({ %$self }, ref $self);
$new-context($c);
return $new;
}
Isn't that really really slow
I'm guessing you didn't change the line which says:
use base 'Catalyst::Controller';
to:
use base 'Catalyst::Controller::FormBuilder';
Mark
On Thursday 01 February 2007 8:39 pm, rahed wrote:
Hi,
starting with Catalyst, I went through CatalystBasics tutorial. From the
archive I concluded
I'd just create a separate TT view instance eg i call my website
view 'C::V::Website' and my email view 'C::V::Email' and then just parse it
through that - means you can have different dirs /root/website
and /root/email with different variables - the email and website views are
generally very
Hi there,
Is there any (vaguely simple?) way to see where all the memory is being used
in a catalyst application? This kinda follows on from the previous thread on
mod_perl memory usage, but I'd like to use something like Devel::Monitor or
Devel::ObjectTracker to monitor all objects created by
You could of course do somethnig like:
push @lname = $c-model('myDB::Author')-get_column('last_name')-all;
tmtowtdi
Mark
On Wednesday 14 February 2007 5:21 pm, A. Pagaltzis wrote:
Hi Ian,
* Ian Docherty [EMAIL PROTECTED] [2007-02-14 16:40]:
A. Pagaltzis wrote:
* Will Smith [EMAIL
wrt radioboxes on forms/dbic; I have been doing a true/false/null using the
following:
invited:
label: Invited?
options: 1=Yes, 0=No
required: 0
As this is not required, if nothing is sent back the value will be undef =
null; otherwise 1/0 will be returned based on
Something else i wanted to do was to be able to define 'blocks' which would go
on my form; for example:
form:
INCLUDE 'name.fb'
INCLUDE 'address.fb'
To get a default name block and then an address block appended to my form.
Using HTML::Widget you could do -merge which is something i'm yet
Hi,
I have found a bug with catalyst, when Catalyst::Engine::HTTP is used with
parse_on_demand set to true, and POST content. when I post, the
connection 'hangs'. if i hit esc in the browser, I get the following cat
output:
Can't call FIRSTKEY method on handle DBI::db=HASH(0x9858670) after
After spending the past two hours looking through code etc, I finally
discovered this was a bug of my own making. Basically, I've written a custom
little FormBuilder controller module that loads .pm files with formbuilder
specs. As part of that, it specified that it wanted { params = $c-req },
Hi,
I'm trying to work out the 'best way' of solving the following problem.
Basically, I want to have several entries into my application. One is of the
form /foo/id where id is an integer primary key. Another
is /bar/other_key where other_key is some string key, and another is via a
virtual
the
url back into catalyst...
Mark
On Saturday 19 May 2007 9:18 pm, Robert 'phaylon' Sedlacek wrote:
Mark Zealey wrote:
Hi,
I'm trying to work out the 'best way' of solving the following problem.
Basically, I want to have several entries into my application. One is of
the form /foo/id
Hi there,
I was wondering if there was some way within the Catalyst api to redispatch
calls. The problem I'm having is:
package MyApp::C::Blah;
sub add : Local :Form(...) {
if($form-submitted) {
# Add to database
$c-res-redirect($c-uri_for('view'))
}
# Generate form and display
}
You said absolutely nothing to address the “wrong URL”
problem Matt mentioned, btw.
What wrong URL? My example showed that
http://example.com/data/update is virtually equal to
http://example.com/data/view if not posted from a form.
Of course they are virtually equal – after all
check out Catalyst::Controller::FormBuilder - it'll autogenerate your forms
for you, handle validation etc etc.
M
On Tuesday 03 July 2007 7:19 pm, Andrew Hayward wrote:
I'm relatively new to this Catalyst malarkey, so you'll have to bear
with me for a minute.
I was wondering if it possible
In the debugger you can just hit ctl-c when it's looping and it'll stop your
program and tell you where you are, stack frames etc..
M
On Sunday 08 July 2007 6:30 pm, Daniel McBrearty wrote:
in the middle of working on another part of the app altogether,
suddenly when I start up, just trying
Perhaps I'm missing something, but what's the problem with doing something
like:
package MyApp;
$SIG{INT} = sub {
graceful_shutdown();
exit(1);
}
END { graceful_shutdown() }
sub graceful_shutdown {
# Code here...
}
Note that a $SIG{INT} will not exit if you override it, which is why
I use:
package MyApp;
use Catalyst qw/ ... /;
my @extra_plugins;
if( $ENV{CATALYST_DEBUG} ) {
push @extra_plugins = qw/ Static::Simple StackTrace /;
}
# Start the application
__PACKAGE__-setup( @extra_plugins );
Mark
On Monday 16 July 2007 1:48 pm, Daniel McBrearty wrote:
is there a
I work for pipex hosting, who own 123-reg.
123-reg have cheap dedi servers (from £40/mo) running ubuntu
(http://www.123-reg.co.uk/dedicated-server-hosting/). You can get root access
(actually a chroot, but you get full control of the box and the ip) and we
even put catalyst on there as
The __FILE__ compile-time constant may be of some use.. You should be able to
get the directory of the current module by doing something like:
package MyApp::I18N::foo;
use strict;
sub get_my_dir {
my ($dir) = __FILE__ =~ m!^ (.*) / [^/]+ !x;
return $dir;
}
Of course, if you wanted to do
22 matches
Mail list logo