-
-
Save devfabriciobr/807947e880e39b71d0e415b76bcb5b2e to your computer and use it in GitHub Desktop.
EXEMPLO TQuestion SIM ou NÃO
This file contains hidden or 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 | |
| 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