Skip to content

Using a variable for attributes in a tag helper #1653

Answered by smonff
smonff asked this question in Q&A
Discussion options

You must be logged in to vote

The idea of using the configuration system for this was awful because you need to restart the app each time you change something manually. I just replaced this by a normal module that I use in the helper.

use Mojo::Base -base, -signatures;

use constant {
  WHITE      => '#FFFFFF',
  MAIN_WIDTH => 600,
  CELLZERO   => {
    cellpadding => '0',
    cellspacing => '0',
  },
};

sub css {
  return {
    body => {
      leftmargin => '0',
      topmargin => '0',
      marginwidth => '0',
      marginheight => '0',
    },
    'top-table' => {
      bgcolor => WHITE,
      width => '100%',
      border => '0',
      CELLZERO->%*,    
    },
    'content-table' => {
      align => ' center',
      

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@smonff
Comment options

Answer selected by smonff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant