<?php namespace App\Controllers;
+<?php
-use CodeIgniter\Controller;
+namespace App\Controllers;
-class Tools extends Controller {
+use CodeIgniter\Controller;
- public function message($to = 'World')
- {
- echo "Hello {$to}!".PHP_EOL;
- }
+class Tools extends Controller
+{
+ public function message($to = 'World')
+ {
+ echo "Hello {$to}!" . PHP_EOL;
+ }
}
@@ -453,7 +459,7 @@
+
You may always pass --no-header
to suppress the header output, helpful for parsing results:
+
> php spark cache:clear --no-header
+
+
對於 CodeIgniter 所提供的指令,如果你沒有鍵入它所需要的參數,你將會被提示正確運作指令應該需要的要求:
> php spark migrate:version
> Version?
+
+
+
Commands can also be ran from within your own code. This is most often done within a controller for cronjob tasks,
+but they can be used at any time. You do this by using the command()
function. This function is always available.
+
echo command('migrate:create TestMigration');
+
+
+
The only argument is string that is the command called and any parameters. This appears exactly as you would call
+it from the command line.
+
All output from the command that is ran is captured when not run from the command line. It is returned from the command
+so that you can choose to display it or not.
+
-
+
你可以使用下列的提示指令來獲得在命令列介面中任何指令的提示資訊:
-
Use the list command to get a list of available commands and their descriptions, sorted by categories. You may also use spark list –simple to get a raw list of all available commands, sorted alphabetically.
+
Use the list command to get a list of available commands and their descriptions, sorted by categories.
+You may also use spark list --simple
to get a raw list of all available commands, sorted alphabetically.