This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - isAdmin проверяет является ли админов (bool) | |
2 - hasAccess проверяет наличие доступа (bool) | |
3 - isDeleted проверяет была ли удалена (bool) | |
4 - getName вернуть имя (str) | |
5 - setName задать имя (void) | |
6 - getOptions получить опции (arr) | |
7 - getArgument получить аргумент (all) | |
8 - signIn авторизация (void) | |
9 - login(…)->password(…)->authenticate() проверяет логгин пароль и авторизует (bool) | |
10 - logout выйти из учётки (bool) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Через Interface | |
//разбить на логические блоки | |
class Customer { // psr-2 "{" c новой строки | |
public $name; | |
public $rentals; | |
public function __construct($name) { | |
$this->name = $name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace godzula\Container; | |
use ArrayAccess; | |
class Container implements ArrayAccess { | |
private $container = array(); | |
public function __construct() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date = (isset($_POST['date']))? date('d.m.Y',strtotime($_POST['date'])) : date('d.m.Y',strtotime('-3 day')); | |
$url = 'https://api.privatbank.ua/p24api/exchange_rates?date='.$date; | |
$curl = curl_init($url); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
$page = curl_exec($curl); | |
curl_close($curl); | |
unset($curl); | |
$xml = new SimpleXMLElement($page); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class News extends Model | |
{ | |
protected $guarded = []; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateNewsTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use Illuminate\Support\Facades\DB; | |
class ModelBaseFunction | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class UserController extends Controller | |
{ | |
private $column = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', '1'); | |
error_reporting(E_ALL); | |
include 'WorkWithDatabase.php'; | |
$db=new WorkWithDatabase('root','','localhost','utf8','dz15'); | |
$dataBaseConnectionsWithParams=$db->connectWithParams('localhost','dz15','root',''); | |
$table = 'cars'; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', '1'); | |
error_reporting(E_ALL); | |
include 'WorkWithDatabase.php'; | |
include 'WorkWithXML.php'; | |
$db=new WorkWithDatabase('root','','localhost','utf8','dz11'); | |
$wXml=new WorkWithXML('root','','localhost','utf8','dz11'); | |
$dataBaseConnectionsWithParams=$db->connectWithParams('localhost','dz11','root',''); | |
$table = 'users_dz11'; |
NewerOlder