[Phpmyadmin-devel] cleaning up mixed html and php

Dieter Adriaenssens dieter.adriaenssens at gmail.com
Tue Sep 4 20:51:17 CEST 2012


Hi,

When fixing coding style issues, I noticed a lot of mixed php and
html, especially in the files in the rootdir of the pma.

F.e. : <div id='<?php echo htmlentities($name); ?>' class='someclass'>

or even worse :

<?php
if ($something) {
?><p>Some conditional text</p>
<?php } ?>
<p>Some unconditional text</p>


It generates a lot of codingstyle errors : too long lines, wrong
indentation, ...
it is badly structured and thus difficult to read and to be honest, is ugly.

I'm thinking of starting to clean it up towards 4.0, using either
echo's or assigning the output html to a string and add it to the
appropriate Response class method.

f.e. :

<?php

$response = PMA_Response::getInstance();

$output = "";

\\ some code in between

if (something) {
    $output .= "<p>Some conditional text</p>";
}
$output .= "Some unconditional text</p>";

\\ some code in between

$response->addHTML($output);
?>


Any thoughts?

-- 
Kind regards,

Dieter Adriaenssens




More information about the Developers mailing list