~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Helper/ByteFormatterTwigExtension.php

  • Committer: Dan Garner
  • Date: 2015-11-20 14:18:04 UTC
  • mfrom: (454.3.22)
  • Revision ID: git-v1:140e411ecd1777e5e9a27bf4326db2d8f947d534
Merge pull request #125 from dasgarner/upgrader

Upgrader

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\Helper;
10
 
 
11
 
 
12
 
class ByteFormatterTwigExtension extends \Twig_Extension
13
 
{
14
 
    public function getName()
15
 
    {
16
 
        return 'byteFormatter';
17
 
    }
18
 
 
19
 
    public function getFilters()
20
 
    {
21
 
        return array(
22
 
            new \Twig_SimpleFilter('byteFormat', array($this, 'byteFormat'))
23
 
        );
24
 
    }
25
 
 
26
 
    public function byteFormat($bytes)
27
 
    {
28
 
        return ByteFormatter::format($bytes);
29
 
    }
30
 
}
 
 
b'\\ No newline at end of file'