[mythtv] MythWeb Skinning (Was: Re: mythweb screenshot)

Christopher Maahs cmaahs at eatenbygrue.com
Mon Jun 9 12:22:36 EDT 2003


Sounds good.

Here is a quick example of what I've seen done to split the html and the 
php code:

template class
--------------
<?
class html_programguide
{
  function header($var1, $var2)
  {
    return <<<EOT
{whatever html code for the header}
EOT;
  }

   function guiderow($progdata)
   {
    return <<<EOT
{whatever html code for each program}
EOT;
   }

   function footer($var1)
   {
    return <<<EOT
{footer html}
EOT;
   }
}


php program code
----------------
$tmpl_programguide = new html_programguide;

$html_out = $tmpl_programguide->header("Title", "Other Data");
{database loop}
$html_out .= $tmpl_programguide->guiderow($db_progdata);
{database loop}
$html_out .= $tmpl_programguide->footer("Copyright Info");

echo $html_out;



Hopefully that gives a decent idea of how that works.  One might create a 
html_standard class for your base headers and footers or whatnot.  And 
then obviously have a html class for each page type.

~cj

On 9 Jun 2003, Chris Petersen wrote:

> > In looking at the MythWeb code lately, I was curious if it might not be 
> > worth the time to separate the html code into class functions and put the 
> > class files into ./skin/{skinname} directories.



More information about the mythtv-dev mailing list