Posts by Flávio Santos • 136 points
8 posts
-
1
votes1
answer140
viewsA: Conditional if more cleancode
I always find a good extract for functions. This helps and much in readability: <?php $l1 = 1; $l2 = 7; $c1 = 97; $c2 = 104; if ( entre1E8($l1) && entre1E8($l2) &&…
-
2
votes2
answers48
viewsA: How do I fire an Alert with the click of a button in javascript?
Complementing the answer of pedro, it is nice to separate Javascript from html. It would look like this: document.getElementById("btnAlerta").addEventListener('click', MeuAlerta); function…
-
0
votes1
answer137
viewsA: Problem with Route and IF in Laravel 5.8
The two values cannot be optional if they belong to the route... Because your system will never know which argument was ignored. A nice approach to catch would be the use of querystrings. Edited:…
-
0
votes1
answer188
viewsA: Primary key generation problem spring-boot-jpa
Mysql is a bit more boring to work with UUID, this link, this tutorial shows an alternative solution where you create a null field, and a Trigger that fills with a uuid automatically. A more elegant…
-
0
votes1
answer165
viewsA: Request $request in object-oriented PHP
There is no typing in php at first... But in this case, the variable $request has a type yes, the type Request. Now, imagine with us, you make a code, where you assign a int to the variable $request…
-
1
votes1
answer170
viewsA: Call PHP function via Link using MVC
You need a page, for example, setcookie.php, and on this page, you should instantiate the class you created, more or less like this: $l = new Language(); $l->setLingCookie(); Are you using a…
-
1
votes2
answers1263
viewsA: Sponse() in XML with Laravel
Look at this extension, it works fine: https://github.com/jailtonsc/laravel-response-xml Laravel does not work with xml natively I hope I’ve helped!…
-
1
votes3
answers789
viewsA: Doubt Passing Laravel Array Routes
I suggest to you, instead of passing an array with the values, to pass again the variable used in the search, and to redo this search before generating the pdf. So you don’t have to do the same…