Skip to content

Commit ceb6942

Browse files
Merge pull request #607 from azisyus/master
2 parents 593040a + b8558a5 commit ceb6942

File tree

12 files changed

+40
-19
lines changed

12 files changed

+40
-19
lines changed

src/helpers.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
use Kris\LaravelFormBuilder\Fields\FormField;
44
use Kris\LaravelFormBuilder\Form;
55

6+
7+
if(!function_exists('errorBlockPath'))
8+
{
9+
10+
function errorBlockPath()
11+
{
12+
return __DIR__.'/views/errors.php';
13+
}
14+
15+
}
16+
17+
if(!function_exists('helpBlockPath'))
18+
{
19+
20+
function helpBlockPath()
21+
{
22+
return __DIR__.'/views/help_block.php';
23+
}
24+
25+
}
26+
627
if (!function_exists('form')) {
728

829
function form(Form $form, array $options = [])

src/views/button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<?php endif; ?>
44

55
<?= Form::button($options['label'], $options['attr']) ?>
6-
<?php include 'help_block.php' ?>
6+
<?php include helpBlockPath(); ?>
77

88
<?php if ($options['wrapper'] !== false): ?>
99
</div>

src/views/checkbox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?= Form::customLabel($name, $options['label'], $options['label_attr']) ?>
1212
<?php endif; ?>
1313

14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515
<?php endif; ?>
1616

17-
<?php include 'errors.php' ?>
17+
<?php include errorBlockPath(); ?>
1818

1919
<?php if ($showLabel && $showField): ?>
2020
<?php if ($options['wrapper'] !== false): ?>

src/views/child_form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<?php } ?>
1616
<?php endforeach; ?>
1717

18-
<?php include 'help_block.php' ?>
18+
<?php include helpBlockPath(); ?>
1919

2020
<?php endif; ?>
2121

22-
<?php include 'errors.php' ?>
22+
<?php include errorBlockPath(); ?>
2323

2424
<?php if ($showLabel && $showField): ?>
2525
<?php if ($options['wrapper'] !== false): ?>

src/views/choice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
<?= $child->render($options['choice_options'], true, true, false) ?>
1414
<?php endforeach; ?>
1515

16-
<?php include 'help_block.php' ?>
16+
<?php include helpBlockPath(); ?>
1717

1818
<?php endif; ?>
1919

2020

21-
<?php include 'errors.php' ?>
21+
<?php include errorBlockPath(); ?>
2222

2323
<?php if ($showLabel && $showField): ?>
2424
<?php if ($options['wrapper'] !== false): ?>

src/views/collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<?= $child->render() ?>
1414
<?php endforeach; ?>
1515

16-
<?php include 'help_block.php' ?>
16+
<?php include helpBlockPath(); ?>
1717

1818
<?php endif; ?>
1919

20-
<?php include 'errors.php' ?>
20+
<?php include errorBlockPath(); ?>
2121

2222
<?php if ($showLabel && $showField): ?>
2323
<?php if ($options['wrapper'] !== false): ?>

src/views/radio.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?= Form::customLabel($name, $options['label'], $options['label_attr']) ?>
1212
<?php endif; ?>
1313

14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515
<?php endif; ?>
1616

17-
<?php include 'errors.php' ?>
17+
<?php include errorBlockPath(); ?>
1818

1919
<?php if ($showLabel && $showField): ?>
2020
<?php if ($options['wrapper'] !== false): ?>

src/views/repeated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<?= $options['children']['first']->render([], true, true, false) ?>
99
<?= $options['children']['second']->render([], true, true, false) ?>
1010

11-
<?php include 'help_block.php' ?>
11+
<?php include helpBlockPath(); ?>
1212

1313
<?php endif; ?>
1414

src/views/select.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?php if ($showField): ?>
1212
<?php $emptyVal = $options['empty_value'] ? ['' => $options['empty_value']] : null; ?>
1313
<?= Form::select($name, (array)$emptyVal + $options['choices'], $options['selected'], $options['attr']) ?>
14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515
<?php endif; ?>
1616

17-
<?php include 'errors.php' ?>
17+
<?php include errorBlockPath(); ?>
1818

1919
<?php if ($showLabel && $showField): ?>
2020
<?php if ($options['wrapper'] !== false): ?>

src/views/static.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?php if ($showField): ?>
1212
<<?= $options['tag'] ?> <?= $options['elemAttrs'] ?>><?= e($options['value']) ?></<?= $options['tag'] ?>>
1313

14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515

1616
<?php endif; ?>
1717

0 commit comments

Comments
 (0)