I said I'd stop posting on this forum. I lied. Now, let's talk about some framework shenanigans.
Trongate v2 is good but there's one mistake I made that has been really annoying me. Let me tell you about it.
The whole framework was built with the idea, "Everything is a module".
Enough time has passed for us to know now that this concept is tried, tested and it works. However, at the time, when I made v2, "everything is a module" was a radical, bold and untested concept. So, I sort of bottled it. In other words, I didn't go "all in" for the philosophy. This was a mistake. I should have trusted my instinct. I should have gone "all in". I didn't. It happens to be literally the one thing about Trongate v2 that I wish I could change. It's the one thing that I'm not happy with.
We see this mistake in form_helper.php where we have an assortment of code pertaining to form validation, lurking around the engine directory. That code should have been in the validation module - not in the 'engine' directory.
Here's an example of an instance where this erroneous code is being used:
If I could turn the clocks back, the syntax would be:
Yes, it's more code - however - it clearly communicates where the code lives and it keeps us within the scope of the "everything is a module" philosophy.
This is indeed an annoying error. I'd like to fix it but I don't want to do anything that breaks the framework.
Anyway... I think I have a fix.
Over the next day or two, I'll be dropping a YouTube tutorial that shows you the system. I think you'll like it!
DC
Multilingual Form Validation
1 months ago
1 months ago
#1
1 months ago
#2
That sounds reasonable. Anything that makes the framework more consistent and straightforward is a win in my book. Looking forward to the tutorial!
1 months ago
#3
Thank you!
And, of course, I've just realised that this syntax is horrible and wouldn't work in a view file:
So, the syntax will remain 'as is'. In other words, a completely non-breaking change. However, the general idea stands. Validation code should be offloaded to the validation module. That's where it belongs and it was a mistake to have that code in the 'engine'.
I'm about 65% of the way through this upgrade. I'm hoping I can have it nailed by midnight tomorrow.
I really hope it works and I'm looking forward to showing you this (if I can get it to work!).
Cheers!
And, of course, I've just realised that this syntax is horrible and wouldn't work in a view file:
So, the syntax will remain 'as is'. In other words, a completely non-breaking change. However, the general idea stands. Validation code should be offloaded to the validation module. That's where it belongs and it was a mistake to have that code in the 'engine'.
I'm about 65% of the way through this upgrade. I'm hoping I can have it nailed by midnight tomorrow.
I really hope it works and I'm looking forward to showing you this (if I can get it to work!).
Cheers!
1 months ago
#4
Okay. This is turning out to be quite a cool thing. I'm about 80% done with this and I'm confident that it'll be a good addition to the framework.
So, instead of a boring tutorial, let's make this a live launch.
Thursday 19th March, 8:00pm London time.
Join me for, "Validation for the nations".
Here's the URL:
https://youtube.com/live/EEKbcr7DkhE
We still have several bits n pieces to build and launch as part of our ecosystem. So, putting out these little live launch videos out keeps life interesting. It lets people know that the framework is growing.
I hope to see you on Thursday.
DC
So, instead of a boring tutorial, let's make this a live launch.
Thursday 19th March, 8:00pm London time.
Join me for, "Validation for the nations".
Here's the URL:
https://youtube.com/live/EEKbcr7DkhE
We still have several bits n pieces to build and launch as part of our ecosystem. So, putting out these little live launch videos out keeps life interesting. It lets people know that the framework is growing.
I hope to see you on Thursday.
DC
1 months ago
#5
You can use https://www.php.net/manual/en/closure.bindto.php and https://www.php.net/manual/en/function.debug-backtrace.php in Templates.php render to bind $this as to the calling class / module.
This would effectively make the view file extend from the controller :)
This would effectively make the view file extend from the controller :)
1 months ago
#6
Give me peace in my heart, keep me resting,
Give me peace in my heart, I pray;
Give me peace in my heart, keep me resting,
Keep me resting till the break of day.
Give me peace in my heart, I pray;
Give me peace in my heart, keep me resting,
Keep me resting till the break of day.