[Phpmyadmin-devel] addHtml() usage

Thilina Buddika Abeyrathna thilinaabeyrathna at gmail.com
Sun Jul 29 18:01:41 CEST 2012


On Sun, Jul 29, 2012 at 1:18 PM, <rouslan at placella.com> wrote:

> rouslan at placella.com ha scritto:
>
>
>  Thilina Buddika Abeyrathna <thilinaabeyrathna at gmail.com> ha scritto:
>>
>>  Hi Rouslan,
>>>
>>> How do I use addHtml() function for the following type code,
>>> <div class="-------">
>>>     <?php include('libraries/example.**php'); ?>
>>> </div>
>>> I tried,
>>> $response->addHTML(<div class="........">)
>>> include 'libraries/example.php'
>>> $response->addHTML(</div>)
>>>
>>> But nothing displayed.
>>>
>>
>> Something like this:
>>
>> $response->addHTML('<div class="someClass">');
>> ob_start();
>> include 'libraries/example.php';
>> $content = ob_get_contents();
>> ob_end_clean();
>> $response->addHTML($content);
>> $response->addHTML('</div>');
>>
>
> Oh, and ideally, you'd refactor the library, so that there is a function
> to call, then the above can be reduced to:
>
> include 'libraries/example.php';
>
> $response->addHTML('<div class="someClass">');
> $response->addHTML(**someFunction());
>
> $response->addHTML('</div>');
>
>  And can we use both addHtml() and 'echo' in a script?
>>>
>>
>> Without output buffering, no. And using output buffering just to be
>> able to mix echo and addHTML functions should be frowned upon.
>>
>> See more here:
>> http://wiki.phpmyadmin.net/**pma/Generating_pages_and_ajax_**
>> responses_in_pma4#Hello_world<http://wiki.phpmyadmin.net/pma/Generating_pages_and_ajax_responses_in_pma4#Hello_world>
>> and here:
>> http://wiki.phpmyadmin.net/**pma/Generating_pages_and_ajax_**
>> responses_in_pma4#Overwriting_**response_keys<http://wiki.phpmyadmin.net/pma/Generating_pages_and_ajax_responses_in_pma4#Overwriting_response_keys>
>>
>> Bye,
>> Rouslan
>>
>
>
Thank you very much  Rouslan.

-- 
Regards.

Thilina Abeyrathna
Gtalk : thilinaabeyrathna
skype: thilinabuddika88
thilinaa.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120729/15988453/attachment.html>


More information about the Developers mailing list