Integration Testing Emails
…the same for Twig: self::$container->get(Environment::class).
I love that! Again, the downside is that you really do need to have wkhtmltopdf
installed correctly anywhere you run your tests. That's the cost of doing this.
Before we try it, at the bottom…
Using a Base Email Template
…6 authors... or really, 6 users that
are subscribed to the newsletter... but anywhere from 0 to 6 of these might
actually have recent articles. Spin over to Mailtrap. If you don't see any
emails - try reloading the fixtures again... just in case you…
Context Builder & Service Decoration
…it talks about changing the serialization context dynamically
and gives an example. Steal this BookContextBuilder code. This class
can live anywhere in src/, but to follow the docs, let's create a Serializer/
directory and a new PHP class inside of that called AdminGroupsContextBuilder...
because…
Login Success & the Session
…may make it less secure. As a general
rule, while you can use API tokens in your JavaScript, you should never store
them anywhere - like local storage of cookies due to security. That makes using
API tokens in JavaScript... tricky.
So... if we're not…
Bootstrapping the Bundle & Autoloading
…move the KnpUIpsum class into that directory. And yea, you could
put this into a src/Service directory, or anywhere else you want.
Oh, but this namespace will not work anymore. We need a namespace that's custom
to our bundle. It could be anything…
Child Component
…answer that, there is technically another option: we could just
move the highlightedRowId state into the RepLogList component. And, technically,
this would work! Look closely: RepLogApp isn't using that data anywhere else! So
if we moved the state, everything would work!
But... for a…
Creating a Service Class
…click one of the genuses. Yes!
The fun fact is screaming at us in upper case.
So believe it or not: you just saw one of the most important and commonly-confusing
object-oriented strategies that exist anywhere... in any language! And it's this…
Routing: The URLs of the World
…pull it in. So, even though Symfony only reads this one
routing file, we can pull in routes from anywhere.
So what's up with the @EventBundle magic? The resource should just
point to the path of another file, relative to this one. But if…
Downloading & Configuration
…that didn't work. So let's try pasting the command instead. If you
have PHP 5.4 installed, run this anywhere: we'll use PHP's built-in web server.
If you don't, get with it! PHP 5.3 is ancient. But anyways…
Gherkin
…while vacationing thousands of miles away.
Feature: Remote fence control API
In order to control fence security from anywhere
As an API user
I need to be able to POST JSON instructions that turn fences on/off
The person benefiting in this case is our…
Configurar el despliegue de platform.sh
…stuff above or below.
The config has mounts - for directories that you want to keep persistent between
deploys - PHP extensions, your PHP version, and quite a bit more.
Anywhere inside, paste the dependencies line... and make sure it's not
indented.
And just like that…
Review this Product... in a turbo-frame!
…we submit... gorgeous! Our new review even popped up right above
the form!
Though, hmm. There's no success message anywhere on the page. There was
one before... but now it's gone! What happened?
Look back at the network tools. There are two new…
Using a Full HTML Page to Populate a Frame
…In base.html.twig, scroll back down to
that area. Surround this in a new {% block weather_widget %} and, on the other
side, {% endblock %}.
Back in index.html.twig, anywhere, override that block... but make it empty.
Ok, refresh again and... cool!
At this point…
Fixing External JS + Analytics Code
…it in your browser. It's minified... so pretty
unreadable. Copy the source, close it, spin over to your editor and create a
new file anywhere, like pizza.js... we're not going to actually use this. Paste
the code, select it, then go back…
3rd Party JavaScript Widgets
…this... then go open templates/base.html.twig. Head to the
bottom and paste this in the footer: right before the closing body tag...
though you could put this anywhere.
Cool: this gives us an a tag... which just says "New York weather". Then,
my…
Fixing the Sweetalert Modal
…go forward and... it worked! Wait, I can't scroll...
and nothing is clickable! Inspect element anywhere. Uh oh: a Sweetalert backdrop
element is still there! It's invisible, but it's blocking the page!
This is the exact same problem we just saw with…
State in your Controller
…usable methods in my
controller as possible. The nice thing about setSelectedColor() is that it's
not dependent on the event: before we were reading event.currentTarget.
Now, anyone can call this method from anywhere, pass a color id and...
everything will just work! Well…
Current Product Id
…read this in a Vue component? Well... it's a global variable... so
we could put window.currentProductId anywhere. But in the last tutorial, we
started centralizing these global variables into a services/page-context.js file.
As a reminder, services/ is a directory that…
Adding a Watcher
…we didn't need it! All we needed to do - when onSearchProducts()
was called - was use the term to immediately load the products. There was
no need to store the search term anywhere for later. But now we do have a need!
We do need…
Props: Passing Info into a Child Component
…dev tools
are even more interesting! If you click on , you can still see the
legend data, though, we're not using this anywhere at the moment. And when you
click on
x
513