File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed
Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ public function init()
4444 parent ::init ();
4545 self ::$ plugin = $ this ;
4646
47+ // Handle console commands
48+ if (Craft::$ app instanceof ConsoleApplication) {
49+ $ this ->controllerNamespace = 'nystudio107\transcoder\console\controllers ' ;
50+ }
51+
4752 // Add the Transcoder path to the list of things the Clear Caches tool can delete.
4853 Event::on (
4954 ClearCaches::className (),
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Transcoder plugin for Craft CMS 3.x
4+ *
5+ * Transcoder
6+ *
7+ * @link https://nystudio107.com
8+ * @copyright Copyright (c) 2017 Transcoder
9+ */
10+
11+ namespace nystudio107 \transcoder \console \controllers ;
12+
13+ use nystudio107 \transcoder \Transcoder ;
14+
15+ use Craft ;
16+ use yii \console \Controller ;
17+ use yii \helpers \Console ;
18+
19+ /**
20+ * Default Command
21+ *
22+ * @author Transcoder
23+ * @package Transcoder
24+ * @since 1.0.0
25+ */
26+ class DefaultController extends Controller
27+ {
28+ // Public Methods
29+ // =========================================================================
30+
31+ /**
32+ * Handle transcoder/default console commands
33+ *
34+ * @return mixed
35+ */
36+ public function actionIndex ()
37+ {
38+ $ result = 'something ' ;
39+
40+ echo "Welcome to the console DefaultController actionIndex() method \n" ;
41+
42+ return $ result ;
43+ }
44+
45+ /**
46+ * Handle transcoder/default/do-something console commands
47+ *
48+ * @return mixed
49+ */
50+ public function actionDoSomething ()
51+ {
52+ $ result = 'something ' ;
53+
54+ echo "Welcome to the console DefaultController actionDoSomething() method \n" ;
55+
56+ return $ result ;
57+ }
58+ }
You can’t perform that action at this time.
0 commit comments