Completed
Push — master ( 27bdd8...5825ae )
by
unknown
07:58
created

SpriteTemplate::setDependencies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Charcoal\Admin\Property\Input\Selectize\Template;
4
5
// local dependencies
6
use Charcoal\Admin\Support\BaseUrlTrait;
7
8
// from `pimple`
9
use Pimple\Container;
10
11
// from `charcoal-app`
12
use Charcoal\App\Template\AbstractTemplate;
13
14
/**
15
 * Controller for selectize tempalte
16
 * Controls the display of {@see Charcoal/Property/SpriteProperty} in the context of a selectize input
17
 *
18
 * Sprite Property Input Template
19
 */
20
class SpriteTemplate extends AbstractTemplate
21
{
22
    use BaseUrlTrait;
23
24
    /**
25
     * Show the sprite id besides the icon.
26
     *
27
     * @var boolean
28
     */
29
    protected $showSpriteId = true;
30
31
    /**
32
     * @param Container $container A Pimple DI container.
33
     * @return void
34
     */
35
    protected function setDependencies(Container $container)
36
    {
37
        parent::setDependencies($container);
38
39
        $this->setBaseUrl($container['base-url']);
40
    }
41
42
    /**
43
     * @return boolean
44
     */
45
    public function showSpriteId()
46
    {
47
        return $this->showSpriteId;
48
    }
49
50
    /**
51
     * @param boolean $flag Show the sprite id besides the icon.
52
     * @return self
53
     */
54
    public function setShowSpriteId($flag)
55
    {
56
        $this->showSpriteId = $flag;
57
58
        return $this;
59
    }
60
}
61