Skip to content

Commit 872f953

Browse files
committed
Fix craft 3.9 (yii) error
1 parent 096d4f8 commit 872f953

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

src/ServerPathField.php

+38-35
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Server Path Field plugin for Craft CMS
44
*
5-
* ServerPathField
5+
* ServerPathField
66
*
77
* @author Ryan Whitney, Alexander M. Korn
88
* @link https://github.com/amkdev
@@ -28,45 +28,48 @@
2828
*/
2929
class ServerPathField extends Plugin
3030
{
31-
// Static Properties
32-
// =========================================================================
31+
// Static Properties
32+
// =========================================================================
3333

34-
/**
35-
* @var ServerPathField
36-
*/
37-
public static $plugin;
34+
/**
35+
* @var ServerPathField
36+
*/
37+
public static $plugin;
3838

39-
// Public Methods
40-
// =========================================================================
39+
// Public Methods
40+
// =========================================================================
4141

42-
/**
43-
* @inheritdoc
44-
*/
45-
public function init()
46-
{
47-
parent::init();
48-
self::$plugin = $this;
42+
/**
43+
* @inheritdoc
44+
*/
45+
public function init()
46+
{
4947

50-
// Register our fields
51-
Event::on(
52-
Fields::class,
53-
Fields::EVENT_REGISTER_FIELD_TYPES,
54-
function(RegisterComponentTypesEvent $event) {
55-
$event->types[] = ServerPathFieldType::class;
56-
}
57-
);
48+
$this->controllerNamespace = 'amkdev\\serverpathfield\\fields\\ServerPathFieldType';
5849

59-
Craft::info(
60-
Craft::t(
61-
'server-path-field',
62-
'{name} plugin loaded',
63-
['name' => $this->name]
64-
),
65-
__METHOD__
66-
);
67-
}
50+
parent::init();
51+
self::$plugin = $this;
6852

69-
// Protected Methods
70-
// =========================================================================
53+
// Register our fields
54+
Event::on(
55+
Fields::class,
56+
Fields::EVENT_REGISTER_FIELD_TYPES,
57+
function (RegisterComponentTypesEvent $event) {
58+
$event->types[] = ServerPathFieldType::class;
59+
}
60+
);
61+
62+
Craft::info(
63+
Craft::t(
64+
'server-path-field',
65+
'{name} plugin loaded',
66+
['name' => $this->name]
67+
),
68+
__METHOD__
69+
);
70+
}
71+
72+
// Protected Methods
73+
// =========================================================================
7174

7275
}

0 commit comments

Comments
 (0)