Hi All,<br><br>I want all of my controllers to register there respective URLs with description. this data will be used in template to create dynamic HTML pages.<br>controllers will register URLs at catalyst startup.<br><br>
I have to store this data into variable (not in any file or database) which will be accessible in all the controllers.<br>To get the registration work I have to write statement outside of all controller methods to execute the same at the time of catalyst startup.
<br><br>hope you guys can understand my requirement.<br><br>Thanks,<br>Aditya<br><br><div><span class="gmail_quote">On 8/21/07, <b class="gmail_sendername">John Napiorkowski</b> &lt;<a href="mailto:jjn1056@yahoo.com">jjn1056@yahoo.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>--- Aditya Verma &lt;<a href="mailto:verma.aditya1@gmail.com">verma.aditya1@gmail.com
</a>&gt; wrote:<br><br>&gt; Hi,<br>&gt;<br>&gt; I am running catalyst under apache configured with<br>&gt; mod_perl.<br>&gt;<br>&gt; Can I somehow access stash out methods.<br>&gt;<br>&gt; I want to declare a global variable inside
<br>&gt; controller and outside methods<br>&gt; which will be accessible in all controllers.<br>&gt; stash could be a solution but outside methods<br>&gt; context object is not<br>&gt; available so i don&#39;t have access to stash.
<br>&gt;<br>&gt; please help me solve the problem.<br>&gt;<br>&gt; Thanks,<br>&gt; Aditya<br><br>Hi,<br><br>I may not fully understand your use case, but<br>typically the stash is used for a particular context,<br>not as a global thing.
<br><br>You can alway pass the context to methods that need<br>it.&nbsp;&nbsp;I know it seems cumbersome, but the reason is to<br>make you really think if you need it, the idea being<br>that you should try to decouple your context as much
<br>as possible.<br><br>If you need some global information there are a few<br>ways I can think of:<br><br>1) put it into the configuration file.&nbsp;&nbsp;This is great<br>for static stuff, like admin email address, etc.<br>2) Create a model that provides the information you
<br>need.&nbsp;&nbsp;If this information is based on the current<br>context you can inherit from<br>&quot;Catalyst::Component::ACCEPT_CONTEXT&quot; to build it.<br>3) Create a base controller with a method that gets<br>the information you need.&nbsp;&nbsp;The have the controllers
<br>that need this information inherit from that.<br><br>You might get the suggestion to make this a catalyst<br>plugin, but that&#39;s no longer recommended best<br>practices.&nbsp;&nbsp;Plugins should be reserved for when you<br>
are trulying enhancing/extending the basic Catalyst<br>features.<br><br>Please share with us the details of the use case and<br>maybe we can help.<br><br>--John<br><br><br><br>____________________________________________________________________________________
<br>Choose the right car based on your needs.&nbsp;&nbsp;Check out Yahoo! Autos new Car Finder tool.<br><a href="http://autos.yahoo.com/carfinder/">http://autos.yahoo.com/carfinder/</a><br><br>_______________________________________________
<br>List: <a href="mailto:Catalyst@lists.rawmode.org">Catalyst@lists.rawmode.org</a><br>Listinfo: <a href="http://lists.rawmode.org/mailman/listinfo/catalyst">http://lists.rawmode.org/mailman/listinfo/catalyst</a><br>Searchable archive: 
<a href="http://www.mail-archive.com/catalyst@lists.rawmode.org/">http://www.mail-archive.com/catalyst@lists.rawmode.org/</a><br>Dev site: <a href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a><br></blockquote>
</div><br>