Skip to content

Instantly share code, notes, and snippets.

@estefanionsantos
Created June 25, 2023 04:14
Show Gist options
  • Save estefanionsantos/56abf7a4011f48ce9e95597b83b908cc to your computer and use it in GitHub Desktop.
Save estefanionsantos/56abf7a4011f48ce9e95597b83b908cc to your computer and use it in GitHub Desktop.
Rubricate Anchor Widget 02
<?php
use Rubricate\Widget\AnchorIfWidget;
$if = (1 == 1);
$href = 'https://rubricate.github.io';
$text = 'Rubricate';
$a = new AnchorIfWidget($if, $href, $text);
echo $a->getElement();
/*
$if = (1 == 1); # true
result: <a href="https://rubricate.github.io">Rubricate</a>
$if = (1 == 2); # false
result: null
*/
# EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment