[Phpmyadmin-devel] [two pull requestl] gsoc: Refactoring: Server view
xmujay at gmail.com
xmujay at gmail.com
Sat Apr 6 11:01:38 CEST 2013
>2013/4/5 xmujay at gmail.com <xmujay at gmail.com>:
>> thanks Marc,
>>
>> I updated my pull requests and seperate them to two requests.
>>
>> 1. function PMA_sqlQueryFormInsert refactor:
>>
>> https://github.com/phpmyadmin/phpmyadmin/pull/230
>> https://github.com/phpmyadmin/phpmyadmin/pull/229
>>
>> one more issue, Function A call Function B, but in function B, there will be
>> echo render html.
>> currently, I will echo the html out before enter Functon B.
>>
>> but I have a other method, such as in Function B, just return html content
>> out, and add to outter html.
>>
>> Function A () {
>> $html += B();
>> echo $html;
>> }
>> Function A () {
>> $html = "<form>..";
>> returm $html;
>> }
>>
>
>Firstly, please use bottom posting on this list [0].
Thanks Dieter, I will remember this from now! using bottom posting.
>
>There is no need to echo in either function. Let both of them return a
>Html string, call those functions in the place you need them and echo
>the result there. Or feed it to the addHtml() method from the Response
>class that is already defined in every file behind an accessible page.
>See [1] for more info on how to use this.
>
>BTW : Using the addHtml() method is prefered, but make sure all other
>echo calls and direct output (Html outside <?php ?>) are converted to
>addHtml(), otherwise the loading of the page will brake.
About the render issue at once, our goal is to:
1. remove PHP and HTML mixture
2. render HTML at once
3. using addHtml() instead of echo.
But right now, it is not easy to use addHtml() at this time, because the echo code is everywhere, missing something will break our page.
so I try to refator this issue one step by one.
1. remove PHP and HTML mixture
2. in some function, return $html back to main procudure.
3. echo $html at the end
when most things are ready, I will replace echo to addHtml.
let me know what do you think? thanks
I pull another refactor: [one more refactor] server_databases.php
https://github.com/phpmyadmin/phpmyadmin/pull/232
thanks
xmujay
More information about the Developers
mailing list