SEOToolboxAnalyzerField::createBaseHTML()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
class SEOToolboxAnalyzerField extends LiteralField {
4
5
    public function __construct($name, $url) {
6
        $content = $this->createBaseHTML($name, $url);
7
        parent::__construct($name, $content);
8
    }
9
10
    /**
11
     * Create the html needed to represent this form field
12
     *
13
     * @param $name
14
     * @param $url
15
     * @return string
16
     */
17
    private function createBaseHTML($name, $url) {
18
        $div    = "<div id='seotoolbox_con_{$name}'><div class='clearfix result_cont'></div></div>";
19
        $script = "<script type='text/javascript'>
20
                    new PageAnalyzer(jQuery('#seotoolbox_con_{$name} .result_cont'),'{$url}');
21
                   </script>";
22
        return $div.$script;
23
    }
24
}
25