CakePHP Cookbook 3.x
transformed to camel case when invoked. For example, if you had a hello_world() method inside a shell and invoked it with bin/cake my_shell hello_world, you will need to rename the method to helloWorld. There compatibility. Creating a Command Let’s create our first Command. For this example, we’ll create a simple Hello world command. In your application’s src/Command directory create HelloCommand.php. Put the following extends Command { public function execute(Arguments $args, ConsoleIo $io) { $io->out('Hello world.'); } } Command classes must implement an execute() method that does the bulk of their0 码力 | 1244 页 | 1.05 MB | 1 年前3
 CakePHP Cookbook 3.x
transformed to camel case when invoked. For example, if you had a hello_world() method inside a shell and invoked it with bin/cake my_shell hello_world, you will need to rename the method to helloWorld. There compatibility. Creating a Command Let’s create our first Command. For this example, we’ll create a simple Hello world command. In your application’s src/Command directory create HelloCommand.php. Put the following HelloCommand extends Command { public function execute(Arguments $args, ConsoleIo $io) { $io->out('Hello world.'); } } Command classes must implement an execute() method that does the bulk of their work0 码力 | 967 页 | 2.80 MB | 1 年前3
 CakePHP Cookbook 2.x
is returned.: Html->tag('span', 'Hello World.', array('class' => 'welcome')); ?> // Output Hello World // No text specified. Html->tag('span' supplied, only a starting tag is returned.: Html->para(null, 'Hello World.'); ?> // Output
Hello World.
HtmlHelper::script(mixed $url, mixed $options) Parameters: $url (mixed) Encrypts/Decrypts text using the given key: // Encrypt your text with my_key $secret = Security::cipher('hello world', 'my_key'); // Later decrypt your text $nosecret = Security::cipher($secret, 'my_key'); Warning0 码力 | 1096 页 | 958.62 KB | 1 年前3
 CakePHP Cookbook 2.x
is returned.: Html->tag('span', 'Hello World.', array('class' => 'welcome')); ?> // Output Hello World // No text specified. Html->tag('span' supplied, only a starting tag is returned.: Html->para(null, 'Hello World.'); ?> // Output
Hello World.
HtmlHelper::script(mixed $url, mixed $options) Parameters • $url (mixed) Encrypts/Decrypts text using the given key: // Encrypt your text with my_key $secret = Security::cipher('hello world', 'my_key'); // Later decrypt your text $nosecret = Security::cipher($secret, 'my_key'); Warning:0 码力 | 820 页 | 2.52 MB | 1 年前3
 CakePHP Cookbook 4.x
plugins. Creating a Command Let’s create our first Command. For this example, we’ll create a simple Hello world command. In your application’s src/Command directory create HelloCommand.php. Put the following Command { public function execute(Arguments $args, ConsoleIo $io): int { $io->out('Hello world.'); return static::CODE_SUCCESS; } } Command classes must implement an execute() invoked. Lets call our first command application directory, run: bin/cake hello You should see the following output: Hello world. Our execute() method isn’t very interesting let’s read some input from0 码力 | 1249 页 | 1.04 MB | 1 年前3
 CakePHP Cookbook 4.x
plugins. Creating a Command Let’s create our first Command. For this example, we’ll create a simple Hello world command. In your application’s src/Command directory create HelloCommand.php. Put the following Commands 621 CakePHP Cookbook Documentation, Release 4.x (continued from previous page) { $io->out('Hello world.'); return static::CODE_SUCCESS; } } Command classes must implement an execute() method that invoked. Lets call our first command application directory, run: bin/cake hello You should see the following output: Hello world. Our execute() method isn’t very interesting let’s read some input from0 码力 | 967 页 | 2.88 MB | 1 年前3
 CakePHP Cookbook Documentation 5.xplugins. Creating a Command Let’s create our first Command. For this example, we’ll create a simple Hello world command. In your application’s src/Command directory create HelloCommand.php. Put the following Command { public function execute(Arguments $args, ConsoleIo $io): int { $io->out('Hello world.'); return static::CODE_SUCCESS; } } Command classes must implement an execute() invoked. Lets call our first command application directory, run: bin/cake hello You should see the following output: Hello world. Our execute() method isn’t very interesting let’s read some input from0 码力 | 1080 页 | 939.39 KB | 1 年前3
 CakePHP Cookbook Documentation 5.xplugins. Creating a Command Let’s create our first Command. For this example, we’ll create a simple Hello world command. In your application’s src/Command directory create HelloCommand.php. Put the following Commands 521 CakePHP Cookbook Documentation, Release 5.x (continued from previous page) { $io->out('Hello world.'); return static::CODE_SUCCESS; } } Command classes must implement an execute() method that invoked. Lets call our first command application directory, run: bin/cake hello You should see the following output: Hello world. Our execute() method isn’t very interesting let’s read some input from0 码力 | 848 页 | 2.53 MB | 1 年前3
共 8 条
- 1
 













