Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
Now that we have the ability to watch and un-watch repositories, let's add that functionality to the Project Repos as well.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Open project.php, and
we're going to require two files.
0:00
Inc/authenticate.
0:11
And inc/watch.
0:18
We can then get our subscriptions.
0:21
Then at the beginning of the for each,
0:43
after setting the repo we're
going to check our subscription.
0:45
We'll set subscribed equal to false.
0:50
And then we're going to loop
through our subscriptions.
0:56
If our repo is equal to sub full name.
1:07
Then we'll set subscribed equal to true.
1:25
We can then add the subscription
as part of the package array.
1:31
Subscribed Is equal to
our variable subscribed.
1:40
If we want our alert to display,
1:50
then we're going to have to
add those as an argument.
1:52
Finally, we can update project.html to
include the subscription.html file.
2:04
Let's make a final review of our site.
2:24
Going to the project repos.
2:29
We can now watch our
project repos as well.
2:34
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up