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 | |
require_once '../vendor/autoload.php'; | |
use koolreport\KoolReport; | |
use koolreport\datasources\ArrayDataSource; | |
use koolreport\excel\ExcelExportable; | |
use koolreport\processes\ColumnMeta; | |
class TestReport extends KoolReport |
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 | |
class A | |
{ | |
private $id = 0; | |
public function __construct($id) | |
{ | |
$this->id = $id; | |
} |
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
class Student | |
MAX = 10 | |
@@students = [] | |
attr_accessor :name, :surname, :specialization, :grades | |
def self.factory(hash={}) | |
return nil if @@students.length >= MAX |
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
class OrdersController < ApplicationController | |
before_action :set_order, only: [:show, :edit, :update, :destroy, :print_pdf] | |
def print_pdf | |
order_pdf = Prawn::Document.new | |
order_pdf.text "Name: #{@order.name}" | |
order_pdf.text "Price: #{@order.price}" | |
order_pdf.text "Description: #{@order.description}" |
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 | |
// echo $_SERVER['QUERY_STRING']; | |
$json = file_get_contents('http://api.fap.pl/dealers?'.$_SERVER['QUERY_STRING']); | |
$_json = json_decode($json, TRUE); | |
$out = ''; | |
foreach($_json as $row) | |
{ | |
$out .= substr(row($row)."\n", 1); |