Category Archives: design

CSS tip #1: Scroll

Hi,

just a quick one, let say you have a div that need to have content bigger than it is and need to be able to scroll it, sometime ago i have done it using a scroll using images and javascript but a little while just founded that the overflow property can make this for you !

just in your div class put:

overflow:scroll;

and now if the content of the div is bigger, the scroll bars will be added :D

Regards,

Shadow.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Random Posts

    Foreach objects in smarty

    Hi,

    recently i changed how a REST API sent the info from xml to JSON, that mean that now the arrays was converted into objects after the json_decode(). don’t was too much problem till i see that my smarty templates don’t worked anymore :(

    the change of each file don’t was an option and the convert from objects to arrays is wasting resources in nothing, so i made a hack in the smarty main class :D

    basically in the file Smarty_Compiler.php at line numero 1203 i added this if():

    if(is_object($from)){
    $output .= “\$_from = $from;”;
    $output .= “foreach(\$_from as $key_part=>$item){“;
    }else{

    and in the else, you wrap all the other code to parse arrays :D

    now the foreach will parse objects and arrays :D

    i hope it helps.

    Regards,

    Shadow.

    [Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

    Related Post