Completed
Push — master ( a6ee27...1b5fd0 )
by Antony
47:13
created

KnockoutForm::getSubmit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * KnockoutForm
5
 * 
6
 * Adds a submit binding handlier to the form element to capture click/enter events
7
 * Delivers the form element to the javascript function
8
 * @package Silverstripe Knockout Forms
9
 */
10
class KnockoutForm extends Form {
11
12
	/**
13
	 * $submit
14
	 *
15
	 * @var string the javascript function to run upon a click/enter event
16
	 */
17
	protected $submit;
18
19
	/**
20
	 * casting of variables for security purposes
21
	 *
22
	 * Reference: http://docs.silverstripe.org/en/3.1/developer_guides/security/secure_coding/
23
	 */
24
	protected $casting = array(
25
        "Submit" => "Varchar"
26
    );
27
28
	/**
29
	 * setSubmit
30
	 *
31
	 * @return $this
32
	 */
33
	public function setSubmit($input) {
34
		$this->submit = (string)$input;
35
		return $this;
36
	}
37
38
	/**
39
	 * getSubmit
40
	 *
41
	 * @return boolean
42
	 */
43
	public function getSubmit() {
44
		return $this->submit;
45
	}
46
	
47
48
}
49