Completed
Branch #338-Save_posting_before_movin... (60770e)
by Schlaefer
02:30
created

AppHelper::domId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace App\View\Helper;
14
15
use Cake\View\Helper;
16
use Cake\View\Helper\IdGeneratorTrait;
17
18
/**
19
 * App Helper
20
 *
21
 * @property FormHelper $Form
22
 * @property HtmlHelper $Html
23
 * @property UrlHelper $Url
24
 */
25
class AppHelper extends Helper
26
{
27
    use IdGeneratorTrait;
28
29
    protected static $_tagId = 0;
30
31
    /**
32
     * tag id
33
     *
34
     * @return string
35
     */
36
    public static function tagId()
37
    {
38
        return 'id' . static::$_tagId++;
39
    }
40
41
    /**
42
     * Generate an ID suitable for use in an ID attribute.
43
     *
44
     * @param string $value The value to convert into an ID.
45
     * @return string The generated id.
46
     */
47
    public function domId(string $value)
48
    {
49
        return $this->_domId($value);
50
    }
51
}
52