cgi application & global style sheet
arcnon
created: 2006-03-02 13:22:31
I am trying to add a style sheet to my app. I thought that I could use:
    my $q = $self->query;
    
    $q->start_html(
		-style=>
		{
    		-type => 'text/css',
			-src=>'/styles/print.css',
			-rel => 'stylesheet',	
			-media => 'all'  
		} 
    ); 
I tried it in cgiapp_prerun & cgiapp_postrun. No errors tho.
Re: cgi application & global style sheet
created: 2006-03-02 13:32:18
you could do it in postrun:
sub cgiapp_postrun {
  my ($self, $output_ref) = @_;
  my $q = $self->query;

  $$output_ref = $q->start_html(
        -style=>
        {
            -type => 'text/css',
            -src=>'/styles/print.css',
            -rel => 'stylesheet',    
            -media => 'all'  
        } 
    )
    . $$output_ref;
}
Re^2: cgi application & global style sheet
created: 2006-03-02 14:48:32
your example creates 2 headers



Untitled Document







Maintain Users



Re^3: cgi application & global style sheet
created: 2006-03-02 15:42:49
only if you already generated one in your run mode, and you didn't say you did. either way, i don't think you should be using CGI for generating html, but instead start looking at using templates. See HTML::Template or the Template Toolkit for that.

perlmonks.org content © perlmonks.org and arcnon, rhesa

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03