PHP code example of sfneal / actions
1. Go to this page and download the library: Download sfneal/actions library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sfneal / actions example snippets
$output = (new MockAction('string'))->execute();
>>> 'STRING'
php
use Sfneal\Actions\AbstractAction;
class MockAction extends AbstractAction
{
/**
* @var mixed|string
*/
private $string;
/**
* MockAction constructor.
*
* @param string $string
*/
public function __construct($string = 'output')
{
$this->string = $string;
}
/**
* Execute the action.
*
* @return mixed
*/
public function execute()
{
return strtoupper($this->string);
}
}