Skip to content

Instantly share code, notes, and snippets.

@devfabriciobr
Created November 10, 2025 23:30
Show Gist options
  • Select an option

  • Save devfabriciobr/807947e880e39b71d0e415b76bcb5b2e to your computer and use it in GitHub Desktop.

Select an option

Save devfabriciobr/807947e880e39b71d0e415b76bcb5b2e to your computer and use it in GitHub Desktop.
EXEMPLO TQuestion SIM ou NÃO
<?php
new TQuestion("DESEJA CRIAR NOVO REGISTRO?", new TAction([__CLASS__, 'onYesNovoRegistro']),new TAction([__CLASS__, 'onNoNovoRegistro']), 'ATENÇÃO!','SIM','NÃO');
public static function onYesNovoRegistro($param = null)
{
try
{
$object = new Produto;
$object->nome = 'COCA COLA 2 LITROS';
$object->nome = 10.25;
$object->store();
}
catch (Exception $e)
{
new TMessage('error', $e->getMessage());
}
}
public static function onNoNovoRegistro($param = null)
{
try
{
}
catch (Exception $e)
{
new TMessage('error', $e->getMessage());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment