Page Context "Service"
…need anything to re-render when it changes. That's why it's totally legal
to grab this value in sidebar.vue or anywhere else that needs it.
But I want to kind of future proof our app... and plan ahead for a future
where…
Product Details & Smart vs Dumb Components
…now that we're loading data via Ajax, we need a way to tell the user
that things are loading... not that our server is on fire and they're waiting for
nothing. Let's create a Loading component that we can re-use anywhere.
Private Variables & WeakMap
…it's not attaching any listeners
or adding itself as a reference to anything in the code. In other words, this object
is not attached or referenced anywhere in memory. Because of that, RepLogApp
objects - and their Helper objects - should be eligible for garbage collection…
Map and WeakMap
…southernUSStates to null:
When you try it now, this of course prints "undefined". That makes sense: we're now
passing null to the get() function.
But what you can't see is that the southernUSStates object no longer exists...
anywhere in memory!
Why? In JavaScript…
Immediately Invoked Function Expression!
…that function is its home.
Before, when we weren't inside of any function, our two variables effectively
became global: we could access them from anywhere. But now that we're inside of
a function, the RepLogApp and Helper variables are only accessible from inside…
Custom Filter, getDescription() & properties
… We already know how! Back in CheeseListing, we've done this
before with other filters. Anywhere in here, add @ApiFilter() with
CheeseSearchFilter::class:
Unfortunately, PhpStorm doesn't auto-complete that for me... so I'll copy the class
name and add it on top manually…
Input DTO Validation
…at the bottom, after executing validation, it gets back
these "violations" and throws a ValidationException. This is a special exception
that you can throw from anywhere to trigger the nice validation error response.
So... let's go see it! At the browser, hit Execute and…
Embedded Images
…if it's small. When you
embed, the image doesn't need to be hosted publicly anywhere because it's literally
contained inside the email.
Next, I already mentioned that the style tag doesn't work in gmail... which means
that our email will be…
Logout & Passing API Data to JS on Page Load
…small HTML to bootstrap the Vue app... though I am doing
one interesting thing: I'm passing a prop to Vue called entrypoint. I'm not using
this anywhere... but it's a cool example: entrypoint is the URL to our
documentation "homepage". In theory…
Context Builder: Dynamic Fields/Groups
…test again:
This time... it passes! Context builders are awesome.
Though... they do have one downside: the dynamic groups are not reflected anywhere
in the documentation. Refresh the docs... then open the GET operation for a single
User. The docs say that this will return…
Tags, Compiler Passes & Other Nerdery
…it can! But we need to set this up in our bundle. Open the extension
class, go anywhere in the load() method, and add
$container->registerForAutoconfiguration(WordProviderInterface::class). The feature
that automatically adds tags is called autoconfiguration, and this method returns
a "template" Definition object…
Twig ❤️
…the block
some default content, like with title:
Yep, the browser tab's title is Welcome.
Let's override that! At the top... or really, anywhere, add {% block title %}.
Then say Read , print the title variable, and {% endblock %}:
Try that! Yes! The page title changes…
Services
…is this: everything
is done by a service. If you learn to master services, you can do anything from
anywhere in Symfony.
There's a lot more to say about the topic of services, and so many other parts
of Symfony: configuration, Doctrine & the database…
New Component to Hold our Form
…Now that we have a proper class, we don't need to put
handleFormSubmit() inside of render() anymore. Nope, we can access the props
from anywhere as this.props.
So, copy that function & the const, paste it in the class, turn it into a property,…
HttpKernel::handle() The Heart of Everything
…thing to take-away here is that there is a try-catch block. This means that
if you throw an exception from anywhere inside your application - like a
controller or a service - it’s going to get caught by this block. And when
that happens…
Requiring Authentication
…were with us
for episode 1, we did some pretty advanced error handling stuff at the bottom
of this Application class. What we basically did was add a function that’s
called anytime there’s an exception thrown anywhere. Then, we transform
that into a…
Customizing Error Pages and How Errors are Handled
…an exception happens.
We haven’t talked about events yet, but this basically means that if you
want, you can be nofitied whenever an exception is thrown anywhere in your
code. Why would you do this? You might want to do some extra logging or…
Twig
…s added automatically to any page
that has a valid HTML structure. That's why we didn't see it until we extended
the layout file.
Click anywhere on it to multiply the amount of information it gives you by
100! This is the profiler…
Introduction
…First, download Selenium Server,
which is just a jar file that can live anywhere on your computer. Start
Selenium at the command line by running java -jar followed by the filename.
$ java -jar selenium-server-standalone-2.28.0.jar
Now for the magic…
And where exactly is this tool? I cannot find it to save my life. =S
x
511