GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Catalyst::View::vCard(3) User Contributed Perl Documentation Catalyst::View::vCard(3)

Catalyst::View::vCard - vCard view for Catalyst

    # in a controller...
    my $profile = $foo;
    
    $c->stash->{ vcards }   = [ $profile ];
    $c->stash->{ filename } = $profile->username;
    $c->forward( $c->view( 'vCard' ) );
    
    # in a view...
    package MyApp::View::vCard;
    
    use base qw( Catalyst::View::vCard );
    
    sub convert_to_vcard {
        my( $self, $c, $profile, $vcard ) = @_;
        
        $vcard->nickname( $profile->username );
        $vcard->fullname( $profile->name ) if $profile->name;
        $vcard->email( $profile->email ) if $profile->show_email;
    }

This is a view to help you serialize objects to vCard output. You can configure the output filename by supplying a name in "$c-"stash->{ filename }> (a ".vcf" extension will automatically added for you). A default "convert_to_vcard" implementation is provided, however you can provide your own to map your object to a Text::vCard object.

This method will loop through and call "convert_to_vcard" on all of the items in the "vcards" key of the stash.

This is a default implementation for converting your items to vCard objects. It will try various hash keys or methods based on the naming scheme of Text::vCard's methods.

Brian Cassidy <bricas@cpan.org>

Copyright 2006-2009 by Brian Cassidy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

  • Catalyst
  • Text::vCard
2009-11-19 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.