1. Go to this page and download the library: Download prettybx/support 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/ */
prettybx / support example snippets
class Foo
{
public function bar()
{
return 'Hi!';
}
}
class FooFacade extends \PrettyBx\Support\Base\AbstractFacade
{
protected static function getFacadeAccessor()
{
return Foo::class;
}
}
class Service
{
public function doAction()
{
echo FooFacade::bar(); // Hi!
}
}
use PrettyBx\Support\Traits\LoadsModules;
class SomeService
{
use LoadsModules;
protected $modules = ['iblock', 'catalog'];
public function __construct()
{
$this->loadModules(); // Загрузит те модули, которые указаны в $this->modules
}
public function loadOnDemand()
{
$this->loadModule('sale'); // Загрузит модуль, который был передан
}
}
var_dump(config("connections"));
use PrettyBx\Support\Traits\Validatable;
class Service
{
use Validatable;
public function getValidatedRequestData(): array
{
$rules = [
'ID' => '