@@ -15,12 +15,12 @@ |
||
15 | 15 | */ |
16 | 16 | function useTemplateOverride($data = null) { |
17 | 17 | $template = $this->owner->AlternativeTemplate; |
18 | - if ( isset($template) && $template != '' ) { |
|
18 | + if (isset($template) && $template != '') { |
|
19 | 19 | if ($data) { |
20 | 20 | return $this->owner->customise(new ArrayData($data)) |
21 | - ->renderWith( array( $this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page' ) ); |
|
21 | + ->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page')); |
|
22 | 22 | } else { |
23 | - return $this->owner->renderWith( array( $this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page' ) ); |
|
23 | + return $this->owner->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page')); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | } else { |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | |
12 | 12 | public function updateCMSFields(FieldList $fields) { |
13 | 13 | $templatei18n = _t('TemplateOverride.TEMPLATE', 'Template'); |
14 | - $fields->addFieldToTab( 'Root.'.$templatei18n, new TextField( 'AlternativeTemplate', |
|
15 | - _t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name') ) ); |
|
14 | + $fields->addFieldToTab('Root.'.$templatei18n, new TextField('AlternativeTemplate', |
|
15 | + _t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name'))); |
|
16 | 16 | |
17 | 17 | $info_field = new LiteralField( |
18 | 18 | $name = 'infofield', |
@@ -22,6 +22,6 @@ discard block |
||
22 | 22 | ' require changing.').'</p>' |
23 | 23 | ); |
24 | 24 | |
25 | - $fields->addFieldToTab( 'Root.'.$templatei18n, $info_field ); |
|
25 | + $fields->addFieldToTab('Root.'.$templatei18n, $info_field); |
|
26 | 26 | } |
27 | 27 | } |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | $page->write(); |
12 | 12 | $page->doPublish(); |
13 | 13 | $response = $this->get('/' . $page->URLSegment); |
14 | - $this->assertEquals(200, $response->getStatusCode()); |
|
14 | + $this->assertEquals(200, $response->getStatusCode()); |
|
15 | 15 | |
16 | - // assert the the inner layout template has been used |
|
17 | - $this->assertExactMatchBySelector("div.marker", array( |
|
18 | - "INNER LAYOUT" |
|
16 | + // assert the the inner layout template has been used |
|
17 | + $this->assertExactMatchBySelector("div.marker", array( |
|
18 | + "INNER LAYOUT" |
|
19 | 19 | )); |
20 | 20 | } |
21 | 21 | |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | $page->write(); |
28 | 28 | $page->doPublish(); |
29 | 29 | $response = $this->get('/' . $page->URLSegment); |
30 | - $this->assertEquals(200, $response->getStatusCode()); |
|
30 | + $this->assertEquals(200, $response->getStatusCode()); |
|
31 | 31 | |
32 | - // show the the outer layout template has been used |
|
33 | - $this->assertExactMatchBySelector("div.marker", array( |
|
34 | - "OUTER OF LAYOUT" |
|
32 | + // show the the outer layout template has been used |
|
33 | + $this->assertExactMatchBySelector("div.marker", array( |
|
34 | + "OUTER OF LAYOUT" |
|
35 | 35 | )); |
36 | 36 | } |
37 | 37 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | $page->write(); |
44 | 44 | $page->doPublish(); |
45 | 45 | $response = $this->get('/' . $page->URLSegment); |
46 | - $this->assertEquals(200, $response->getStatusCode()); |
|
47 | - $body = $response->getBody(); |
|
48 | - $this->assertNotContains('OUTER OF LAYOUT', $body); |
|
49 | - $this->assertNotContains('INNER LAYOUT', $body); |
|
46 | + $this->assertEquals(200, $response->getStatusCode()); |
|
47 | + $body = $response->getBody(); |
|
48 | + $this->assertNotContains('OUTER OF LAYOUT', $body); |
|
49 | + $this->assertNotContains('INNER LAYOUT', $body); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $page->AlternativeTemplate = 'PageInnerTest'; |
11 | 11 | $page->write(); |
12 | 12 | $page->doPublish(); |
13 | - $response = $this->get('/' . $page->URLSegment); |
|
13 | + $response = $this->get('/'.$page->URLSegment); |
|
14 | 14 | $this->assertEquals(200, $response->getStatusCode()); |
15 | 15 | |
16 | 16 | // assert the the inner layout template has been used |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $page->AlternativeTemplate = 'PageOuterTest'; |
27 | 27 | $page->write(); |
28 | 28 | $page->doPublish(); |
29 | - $response = $this->get('/' . $page->URLSegment); |
|
29 | + $response = $this->get('/'.$page->URLSegment); |
|
30 | 30 | $this->assertEquals(200, $response->getStatusCode()); |
31 | 31 | |
32 | 32 | // show the the outer layout template has been used |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $page->AlternativeTemplate = null; |
43 | 43 | $page->write(); |
44 | 44 | $page->doPublish(); |
45 | - $response = $this->get('/' . $page->URLSegment); |
|
45 | + $response = $this->get('/'.$page->URLSegment); |
|
46 | 46 | $this->assertEquals(200, $response->getStatusCode()); |
47 | 47 | $body = $response->getBody(); |
48 | 48 | $this->assertNotContains('OUTER OF LAYOUT', $body); |