Skip to content

Instantly share code, notes, and snippets.

@eriktorsner
Created April 25, 2017 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eriktorsner/c0ca164cc99f5d5c09b21044731da952 to your computer and use it in GitHub Desktop.
Save eriktorsner/c0ca164cc99f5d5c09b21044731da952 to your computer and use it in GitHub Desktop.
Snippet 3 from helloTestable.php
<?php
/**
* Output the lyric string
*/
public function echoLyric()
{
$lyricString = $this->lyrics->getLyric();
echo "<p id='dolly'>$lyricString</p>";
}
/**
* Output plugin css
*/
public function echoCss()
{
// This makes sure that the positioning is also good for right-to-left languages
$x = is_rtl() ? 'left' : 'right';
echo "\n<style type='text/css'>
#dolly {
float: $x;
padding-$x: 15px;
padding-top: 5px;
margin: 0;
font-size: 11px;
}
</style>\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment