Page 1 of 1

insert_block() ruins arguments containing HTML

Posted: 12 June 2013, 16:33
by pikiou
I find it great to color player names whenever they are shown. It makes they more readable (as long as they are not dark on a dark background or something...)
But since it adds HTML code to plain text, it's troublesome.

In mygame.view.php, I have this:

Code: Select all

$this->page->insert_block("player_district", Array(
   'DISTRICT_OF' => str_replace('$playerName', $this->game->coloredPlayerName($player), self::_('District of $playerName'))
));
And guess what, $this->game->coloredPlayerName() returns some HTML which $this->page->insert_block() seems to processes through htmlentities() and screw up.

Now, for the question: how can I make $this->page->insert_block() not put some arguments through htmlentities()? Or even better, how can I easily make this work?
Thanks ^^

Re: insert_block() ruins arguments containing HTML

Posted: 12 June 2013, 16:42
by sourisdudesert
Hello,

You can use this:

Code: Select all

$this->page->insert_block("your_blockt", Array(
   'SOME_ARGUMENT' => self::raw( $some_html )
));
http://en.doc.boardgamearena.com/Game_l ... #Variables

Cheers,

Re: insert_block() ruins arguments containing HTML

Posted: 12 June 2013, 16:44
by pikiou
This is magic!
Thanks ^^