Skip to content

Instantly share code, notes, and snippets.

@obilodeau
Created August 16, 2012 17:47
Show Gist options
  • Save obilodeau/3372029 to your computer and use it in GitHub Desktop.
Save obilodeau/3372029 to your computer and use it in GitHub Desktop.
refacotring to portalSession
# This
my $vars = pf::web::_initialize_template_variables(
destination_url => encode_entities($portalSession->getDestinationUrl),
list_help_info => [
{ name => i18n('IP'), value => $portalSession->getClientIp },
{ name => i18n('MAC'), value => $portalSession->getClientMac }
],
);
# would become
$portalSession->stash->{destination_url} = encode_entities($portalSession->getDestinationUrl);
$portalSession->stash->{list_help_info} = [
{ name => i18n('IP'), value => $portalSession->getClientIp },
{ name => i18n('MAC'), value => $portalSession->getClientMac }
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment