Check this out: <a href="http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Attributes">http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Attributes</a> and <a href="http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Action_classes">http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Action_classes</a><br>

<br><br><div class="gmail_quote">On Mon, Jul 13, 2009 at 12:27 AM, Toby Corkindale <span dir="ltr">&lt;<a href="mailto:toby.corkindale@strategicdata.com.au">toby.corkindale@strategicdata.com.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">Toby Corkindale wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I wondered if anyone could point me towards a working example of creating custom action attribute handlers for Catalyst?<br>
<br>
eg. The contents of Catalyst::Controller::SecretAgent in the example below:<br>
<br>
<br>
package MyApp::Controller::M;<br>
use parent &#39;Catalyst::Controller::SecretAgent&#39;;<br>
# Provides Vehicle() and Gimmick() actions.<br>
<br>
sub bond : Vehicle(&#39;Aston Martin&#39;) {<br>
  my ($self, $c) = @_;<br>
  # ...<br>
}<br>
<br>
sub maxwell_smart : Gimmick(&#39;Shoe-phone&#39;) {<br>
  My ($self, $c) = @_;<br>
  #...<br>
}<br>
<br>
1;<br>
</blockquote>
<br>
<br></div>
I should clarify what I&#39;m after..<br>
I&#39;d still like to be able to specify regular DispatchType attributes against the routines (eg. Local, Chained, etc), but I&#39;d also like to have my own methods called against the other attributes I&#39;ve specified.<br>


<br>
The first method I tried was:<br>
  package Catalyst::Controller::SecretAgent;<br>
  use strict / use warnings<br>
  use parent &#39;Catalyst::Controller&#39;;<br>
  use attributes __PACKAGE__ =&gt; \&amp;set_vehicle, &quot;Vehicle&quot;;<br>
  sub set_vehicle { # do something }<br>
  ...<br>
<br>
but I think that messes up catalyst&#39;s own handling of attributes.<div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Devin Austin<br><a href="http://www.codedright.net">http://www.codedright.net</a><br><a href="http://www.dreamhost.com/r.cgi?326568/hosting.html">http://www.dreamhost.com/r.cgi?326568/hosting.html</a> - Host with DreamHost!<br>