~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Twig/ByteFormatterTwigExtension.php

  • Committer: Dan Garner
  • Date: 2015-09-29 15:16:59 UTC
  • mto: (454.2.11) (471.2.2)
  • mto: This revision was merged to the branch mainline in revision 468.
  • Revision ID: git-v1:ae24387a7b1397750b6ec86d0f286373da05eb16
Fixed Display Version Information Form (not showing media name)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2015 Spring Signage Ltd
5
 
 * (ByteFormatterTwigExtension.php)
6
 
 */
7
 
 
8
 
 
9
 
namespace Xibo\Twig;
10
 
 
11
 
 
12
 
use Xibo\Helper\ByteFormatter;
13
 
 
14
 
class ByteFormatterTwigExtension extends \Twig_Extension
15
 
{
16
 
    public function getName()
17
 
    {
18
 
        return 'byteFormatter';
19
 
    }
20
 
 
21
 
    public function getFilters()
22
 
    {
23
 
        return array(
24
 
            new \Twig_SimpleFilter('byteFormat', array($this, 'byteFormat'))
25
 
        );
26
 
    }
27
 
 
28
 
    public function byteFormat($bytes)
29
 
    {
30
 
        return ByteFormatter::format($bytes);
31
 
    }
32
 
}
 
 
b'\\ No newline at end of file'