This file contains hidden or 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
$table->integer('post_id')->unsigned(); | |
$table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade'); |
This file contains hidden or 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 console\controllers; | |
use yii\console\Controller; | |
use yii\helpers\Console; | |
class ProgressController extends Controller { | |
public function actionIndex(){ | |
$result = $this->prompt("запуск прогресс бара: "); |
This file contains hidden or 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 console\controllers; | |
use yii\console\Controller; | |
use yii\helpers\Console; | |
class ArrayController extends Controller { | |
public function actionIndex(){ | |
$result = array(12,36,45,55,44,122,5,2,7); |
This file contains hidden or 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
var canvas = document.getElementById('canvas'); | |
var width = canvas.width; | |
var height = canvas.height; | |
var renderer = new THREE.WebGLRenderer({canvas:canvas}); | |
renderer.setClearColor(0xFFFFFF); | |
//создание сцены: |
This file contains hidden or 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
/* фабрика */ | |
class Auto { | |
private $_make; | |
private $_model; | |
public function __construct($make, $model){ | |
$this->_make = $make; | |
$this->_model = $model; | |
} | |
public function getMakeModel(){ |
This file contains hidden or 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
interface BarInterface { | |
} | |
class Bar implements BarInterface | |
{ | |
} | |
App::bind('BarInterface','bar'); |
This file contains hidden or 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
#include<stdio.h> //библиотека ввода/вывода | |
//#include<stdlib.h> // библиотека для функции getchar() для линукца | |
#include<conio.h> | |
// | |
int main(){ | |
int n,a,b,result; | |
char opt; | |
do { | |
printf("колавиша 1: сложение\n"); |
This file contains hidden or 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
$factory->define(App\Post::class, function (Faker\Generator $faker) { | |
return [ | |
'title' => $faker->title, | |
'body' => $faker->paragraph(10), | |
'user_id'=>function () { | |
return factory(App\User::class)->create()->id; | |
} | |
This file contains hidden or 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
Schema::create('pages', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->string('name_page'); | |
$table->string('meta_k'); | |
$table->string('meta_d'); | |
$table->text('content'); | |
$table->integer('category_id')->unsigned(); | |
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); | |
$table->timestamps(); | |
}); |
This file contains hidden or 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
@inject('obj', 'App\КлассМодели::СататическийМетод') |