Skip to content

Instantly share code, notes, and snippets.

@estefanionsantos
estefanionsantos / main.php
Last active April 8, 2022 17:26
main.php 01
<?php
use App\Helper\ViewHelper;
$view = new ViewHelper();
$view->render('home');
# source: src/view/home.php
/*
<html>
@estefanionsantos
estefanionsantos / home.php
Created April 3, 2022 16:46
home view 01
<h1>Home</h1>
some text here
<?php
namespace App\Helper;
use Rubricate\Resource\DirectoryPathResource;
use Rubricate\Resource\FileResource;
use Rubricate\Resource\BufferResource;
class ViewHelper
@estefanionsantos
estefanionsantos / table.example03.php
Created September 15, 2021 20:24
table.example03
<?php
$data = include 'dataArr.php';
$table = new Rubricate\Table\ContainerTable();
$header = new Rubricate\Table\HeadRowTable();
$body = new Rubricate\Table\BodyTable();
$foot = new Rubricate\Table\FootRowTable();
@estefanionsantos
estefanionsantos / table.example02.php
Last active September 15, 2021 20:22
table.example02
<?php
$data = include 'dataArr.php';
$alignLeft = array('align'=>'left');
$table = new Rubricate\Table\ContainerTable();
$body = new Rubricate\Table\BodyTable();
@estefanionsantos
estefanionsantos / table.example01.php
Created September 15, 2021 20:17
table.example01
<?php
$data = include 'dataArr.php';
$table = new Rubricate\Table\ContainerTable();
$header = new Rubricate\Table\HeadRowTable();
$body = new Rubricate\Table\BodyTable();
$table->setAttribute('border', '1');
@estefanionsantos
estefanionsantos / dataArr.php
Created September 15, 2021 20:09
table.example.data.arr
<?php
/* fileName: dataArr.php */
$data[] = array(
'id' => 1,
'name' => 'John',
'user' => '@john',
'occupation' => 'Engineer',
'salary' => '18000',
@estefanionsantos
estefanionsantos / input.form.rubricate.php
Created September 8, 2021 01:59
input form rubricate
<?php
use Rubricate\Form\InputForm;
$name = new InputForm('text', 'name', 'john');
$email = new InputForm('email', 'email', '[email protected]');
$password = new InputForm('password', 'password', '123456');
$age = new InputForm('number', 'age', '25');
$phone = new InputForm('tel', 'phone', '5551999999');
@estefanionsantos
estefanionsantos / textarea.form.rubricate.php
Created September 8, 2021 01:02
textarea form rubricate
<?php
use Rubricate\Form\TextareaForm;
use Rubricate\Form\LabelForm;
use Rubricate\Element\CreateElement;
$div = new CreateElement('div');
$lab = new LabelForm('Message:');
$msg = new TextareaForm('message');
@estefanionsantos
estefanionsantos / text.form.rubricate.php
Created September 8, 2021 00:59
text form rubricate
<?php
use Rubricate\Form\TextForm;
use Rubricate\Form\LabelForm;
use Rubricate\Element\CreateElement;
$div = new CreateElement('div');
$lab = new LabelForm('First Name:');
$txt = new TextForm('firstName', 'john');