/** * * @see Num::format_bytes */ public function test_format_bytes() { $output = Num::format_bytes('204800'); $expected = '200 KB'; $this->assertEquals($expected, $output); $output = Num::format_bytes('invalid'); $this->assertFalse($output); }
<?php echo $file->original_name; ?> </a></h5> <?php } ?> <p class="subinfo<?php if ($is_subinfo_pull_right) { ?> pull-right<?php } ?> "> <?php echo Num::format_bytes($file->size); ?> <?php echo Html::anchor('#', '<i class="glyphicon glyphicon-trash"></i>', $delete_btn_attr); ?> </p> <?php if ($is_display_textarea) { ?> <p><?php echo Form::textarea(sprintf($prefix . '_description[%d]', $file->id), isset($file->description) ? $file->description : '', array('rows' => 2, 'placeholder' => '写真の説明', 'class' => 'form-control', 'id' => sprintf($prefix . '_description_%d', $file->id))); ?> </p> <?php } ?>
</div><!-- .form-group --> <div class="form-group"> <label class="sr-only" for="<?php echo $selects['name']; ?> "><?php echo $selects['label']; ?> </label> <?php $atters = array_merge(array('class' => 'form-control input-sm'), $selects['atters']); echo Form::select($selects['name'], $selects['value'], $selects['options'], $atters); if (FBD_UPLOAD_MAX_FILESIZE) { ?> <span class="text-muted"><?php echo Num::format_bytes(FBD_UPLOAD_MAX_FILESIZE); ?> まで</span> <?php } ?> </div><!-- .form-group --> </form> <?php } ?> </div><!-- fileinput --> </div><!-- #upload_files --> <?php if ($upload_type == 'img') {