512 search results

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…

4:56
Parameters

…the container. Invent a new one called, how about, cache_adapter set to cache.adapter.apcu: There should now be a new parameter in the container called cache_adapter. We're not using it anywhere... but it should exist. How do we use it? There…

7:59
Creating a Service

…which we will later. So how do we create our very own service? Start by creating a class anywhere in src/. It doesn't matter where but I'll create a new sub-directory called Service/, which I often use when I can't think…

5:03
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…

5:13
Using the Filesystem

…configured as a global bind. And when you configure a bind, it must be used in at least one place in your app. If it's not used anywhere, you get this error. It's kinda nice: Symfony is saying: Hey! You configured this bind…

4:11
Setting up with the Symfony Local Web Server

anywhere, I'll move this into a global bin directory. By the way, you only need to do these steps once on your computer... so you're done forever! Unless we've mucked things up, we should now be able to run this from anywhere

5:15
When Existing Tests Break & Exceptions in __construct()

…fency", whatever that is... true to make it active and $this because it will be attached to this Enclosure. For the addSecurity() method, because we're not using this method anywhere outside of this class, we should technically create it as private. But, I already…

7:20
Mocks & Spies - shouldBeCalledTimes()

…put the assertion stuff after you run your code. Check this out: remove the ->shouldBeCalledTimes() line. Then, anywhere after we call buildEnclosure(), start with $dinosaurFactory->growVelociraptor(Argument::any()) and then ->shouldHaveBeenCalledTimes(2). This does the exact same thing... it's just a different style. Oh…

5:04
Custom Inline Matcher

…How? By creating our own matcher. At the top of your class... or really anywhere, go to the Code -> Generate menu - or Command+N on a Mac - and override a method called getMatchers(). We don't need to call the parent method because its…

5:35
Flex Extras

…new version, your fixtures are services, and so they act like everything else. You can even put them anywhere. When Composer finishes, download one more package: composer require fzaninotto/faker This isn't needed by DoctrineFixturesBundle, but we are going to use it. In fact…

6:31
Deploying Keys & Private Repos

…that public key. Actually, none of this is special to git, this is how SSH key-based authentication works anywhere. Even though our repository is still public, you need some valid SSH key pair in order to authenticate... and our server has nothing. That's…

8:40
Setup: Server Provisioning

…In our Ansible tutorial, we created a small playbook - aws.yml - whose only job is to boot an EC2 instance using an Ubuntu 14.04 image. You're free to get a server from anywhere... but if you do want to use this script to…

8:38
Autowiring Controller Arguments

…>get() call that does not work with private services. Celebrate by removing the first alias! The rest are easy! The app.markdown_extension id isn't referenced anywhere, so remove that. The app.security.login_form_authenticator is used in two places: security.yml and…

6:20
Practicing BDD: Plan, then Build

…icon: Other than some easy-win styling, I want to do as little work as possible to get each step of the scenario to pass. Refresh: there's the button. It doesn't go anywhere yet, try it: This time, it did click "New Product…

8:09
Building a Login Scenario

…s run this! It runs... and fails: The text "Logout" was not found anywhere in the text of the current page. I happen to know this is because the password is wrong. But let's pretend that we didn't know that, and we're…

3:57
BDD Features

…good. What else do we have? Check out the "Fence Security Activated" message on the site. Let's imagine we need to create an API where someone can make an API request to turn the fence security on or off from anywhere. For example, if…

5:56
Twig

…work most of the time. It will even look inside your controller to see what kind of object it is and give you autocomplete on its methods. And remember, anywhere that you get autocomplete, you can hit command+space to see all of your options…

5:01
Parameters

…dir? And we'll set its value to __DIR__: That doesn't do anything, but now we can use that root_dir parameter anywhere else when we're building the container. To use a parameter in Yaml, say %root_dir%: With everything in Yaml, we…

3:29
The window Object & Global Variables

…like RepLogApp, this becomes a global variable. That means you can reference RepLogApp from anywhere else, and this is actually referencing window.RepLogApp. More on that in a second. Inside of our self-executing function, we - of course - also have access to any global variables…

6:12
The Query Builder

…accidentally remove something you added earlier. So, always use andWhere(). Doctrine is smart enough to figure out that, because this is the first WHERE, it doesn't actually need to add the AND. Inside of andWhere(), pass mix.genre =... but don't put the…

10:04