Skip to content

Instantly share code, notes, and snippets.

@estefanionsantos
estefanionsantos / anchor-widget01.php
Last active June 25, 2023 04:06
Rubricate Anchor Widget 01
<?php
use Rubricate\Widget\AnchorWidget;
$href = 'https://rubricate.github.io';
$text = 'Rubricate';
$a = new AnchorWidget($href, $text);
echo $a->getElement();
# <a href="https://rubricate.github.io">Rubricate</a>
@estefanionsantos
estefanionsantos / image-widget01.php
Last active June 24, 2023 23:12
Rubricate widget image 01
<?php
/**
* sintax:
$img = new ImageWidget('image.png');
echo $img->getElement();
*/
use Rubricate\Widget\ImageWidget;
@estefanionsantos
estefanionsantos / dev_2023-09-20.log
Created April 7, 2023 21:02
log output with .log extension
2023-09-20 18:05:00 DEBUG: Array
(
[0] => lorem
[1] => ipsum
[2] => dolor
)
2023-09-20 18:05:00 DEBUG: int(1)
2023-09-20 18:05:00 DEBUG: bool(true)
2023-09-20 18:05:00 DEBUG: some text here
2023-09-20 18:05:00 DEBUG: float(5.2)
<?php
use Rubricate\Logger\AbstractLogger;
class TestLog extends AbstractLogger
{
protected static $ex = '.log';
protected static function getDirFullPath()
{
@estefanionsantos
estefanionsantos / dev_2022-09-20.txt
Last active September 7, 2022 01:06
result log file
2022-09-20 14:05:00 DEBUG: Array
(
[0] => lorem
[1] => ipsum
[2] => dolor
)
2022-09-20 14:05:00 DEBUG: int(1)
2022-09-20 14:05:00 DEBUG: bool(true)
2022-09-20 14:05:00 DEBUG: some text here
2022-09-20 14:05:00 DEBUG: float(5.2)
@estefanionsantos
estefanionsantos / main.php
Last active September 6, 2022 14:11
exemple wasp log
<?php
$arr = [
'lorem',
'ipsum',
'dolor'
];
$int = 1;
$bool = true;
@estefanionsantos
estefanionsantos / TestLog.php
Last active October 4, 2022 20:04
Extending to class AbstractLogger
<?php
use Rubricate\Logger\AbstractLogger;
class TestLog extends AbstractLogger
{
protected static function getDirFullPath()
{
return '/path/to/directory/logs/';
}
@estefanionsantos
estefanionsantos / select.php
Created April 10, 2022 17:08
select element
<?php
use Rubricate\Element\CreateElement;
use Rubricate\Element\StrElement;
$select = new CreateElement('select');
$select->setAttribute('name', 'latim');
$opt[] = 'lorem';
$opt[] = 'ipsum';
@estefanionsantos
estefanionsantos / input.php
Last active October 20, 2022 16:13
input element
<?php
use Rubricate\Element\CreateElement;
$firstName = new CreateElement('input');
$firstName->setAttribute('type', 'text');
$firstName->setAttribute('name', 'firstName');
$firstName->setAttribute('class', 'form');
$firstName->setAttribute('required');
@estefanionsantos
estefanionsantos / image.php
Last active April 7, 2026 23:06
image element
<?php
use Rubricate\Element\CreateElement;
$img1 = new CreateElement('img');
$img1->setAttribute('src', 'image.png');
$img2 = new CreateElement('img');
$img2->setAttribute('src', 'image.png');
$img2->setAttribute('class', 'img-circle');