You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by go...@apache.org on 2004/12/14 22:01:24 UTC

svn commit: r111875 - /perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod

Author: gozer
Date: Tue Dec 14 13:01:22 2004
New Revision: 111875

URL: http://svn.apache.org/viewcvs?view=rev&rev=111875
Log:
Give an example of how to get at the contents of a custom configuration
"container" directive using Apache::Directive::(as_string|as_hash)


Modified:
   perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod

Modified: perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod
Url: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod?view=diff&rev=111875&p1=perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod&r1=111874&p2=perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod&r2=111875
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod	(original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod	Tue Dec 14 13:01:22 2004
@@ -656,7 +656,8 @@
 
 This callback receives three arguments (similar to
 C<L<Apache::TAKE1|/C_Apache__TAKE1_>>), the third of which is a
-string-valued scalar containing the text following the directive.
+string-valued scalar containing the remaining text following the
+directive line.
 
   sub MyParameter {
       my($self, $parms, $val) = @_;
@@ -670,6 +671,17 @@
   req_override => Apache::OR_ALL | Apache::OR_EXEC_ON_READ,
 
 META: complete the details, which are new to 2.0.
+
+To retrieve the contents of a custom "container" directive, use the
+C<L<Apache::Directive>> object's methods 
+C<L<as_hash|Apache::Directive/C_as_hash_>>
+or C<L<as_string|Apache::Directive/C_as_string_>> :
+
+  sub MyParameter {
+      my($self, $parms, $val) = @_;
+      my $directive = $parms->directive;
+      my $content = $directive->as_string;
+  }
 
 There is one other trick to making configuration containers work.  In
 order to be recognized as a valid directive, the I<L<name|/C_name_>>

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Re: svn commit: r111875 - /perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Stas Bekman wrote:
> gozer@apache.org wrote:
> 
>>+To retrieve the contents of a custom "container" directive, use the
>>+C<L<Apache::Directive>> object's methods 
>>+C<L<as_hash|Apache::Directive/C_as_hash_>>
>>+or C<L<as_string|Apache::Directive/C_as_string_>> :
> 
> Even though I made this kind of linking working some time ago, I prefer 
> not to use it. It relies on a very specific search pattern, which prefers 
> 2.0 docs at the moment, thus resolving any conflicts if there is the same 
> filename for 1.0, 2.0, etc. But once a new generation of docs is added 
> (2.2, 3.0) this will stop working. Therefore I think it's beneficial to 
> use a fully-qualified links everywhere: i.e. :
> C<L<Apache::Directive|docs::2.0::api::Apache::Directive>>
> and
> C<L<as_hash|docs::2.0::api::Apache::Directive/C_as_hash_>>
> even though it's uglier and longer to type.
> 
> What do you think?

Think you are right. Fixed!

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: svn commit: r111875 - /perl/modperl/docs/trunk/src/docs/2.0/user/config/custom.pod

Posted by Stas Bekman <st...@stason.org>.
gozer@apache.org wrote:

> +To retrieve the contents of a custom "container" directive, use the
> +C<L<Apache::Directive>> object's methods 
> +C<L<as_hash|Apache::Directive/C_as_hash_>>
> +or C<L<as_string|Apache::Directive/C_as_string_>> :

Even though I made this kind of linking working some time ago, I prefer 
not to use it. It relies on a very specific search pattern, which prefers 
2.0 docs at the moment, thus resolving any conflicts if there is the same 
filename for 1.0, 2.0, etc. But once a new generation of docs is added 
(2.2, 3.0) this will stop working. Therefore I think it's beneficial to 
use a fully-qualified links everywhere: i.e. :
C<L<Apache::Directive|docs::2.0::api::Apache::Directive>>
and
C<L<as_hash|docs::2.0::api::Apache::Directive/C_as_hash_>>
even though it's uglier and longer to type.

What do you think?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org