Jump to content

Please shorten addToStack calls

Featured Replies

Posted

This is a minor annoyance since we generally don't need to call it often, but the simple task of creating language strings takes such a long method call

\IPS\Member::loggedIn()->language()->addToStack('')

I actually have a live template set up for this, but that's a static method call and two consecutive method calls for a common task.

It makes sense that we would, under most sane circumstances, always want to add a language string from the current logged in members set language, so defining this method in \IPS\Lang itself seems like a non-issue to me.

i.e.,

\IPS\Lang::addToStack('')

This is much easier to read and type.

$member->language()->addToStack( 'seems_easy_enough' ); just use $member = \IPS\Member::loggedIn(); at the top of the function etc

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.