blade service injection not working Laravel 5.1 - laravel-5.1

I am trying to inject a controller into my view(blade.php) but it is being outputted as is
#inject('problems', 'App\Http\Controllers\DonnerController')
this line is being printed on the screen, what's wrong here?
My file name is problems.blade.php

So, i found no solution to the problem. I decided to choose a different route since I wanted to share data to my view without any post request sent from page.
I used
View Composers
a better way to share data to views. I took help from laracasts and this tutorial to implement ViewComposers. I hope it may help any future beginner.

Related

Displaying Data From Firebase in iOS in 'Flashcards'

I am developing an iOS app that displays certain words from a Firebase database. The difference, however, is that I want to display the search results in a 'Flashcard' style. I have attached an image to give you an idea of what I am trying to do. I also want it to act as a button (i.e perform some actions when tapped). It would be great if you could help me give me an idea about how I could get this done. Thanks a lot]1
1.) Create a custom collection view. (Guide: https://medium.com/#michaelrojas_66889/how-to-make-a-custom-collection-view-cell-in-swift-6d5783ab7c1c)
2.) Get started with Firebase. (How to get started: https://firebase.google.com/docs/ios/setup)
3.) Setup everything you need for the collection view (Code)
4.) Retrieve values from Firebase. (https://firebase.google.com/docs/database/ios/read-and-write)
At least this is a start where you should begin. There is hundred of guides how to perform something like that, if you're googling the correct way. Once you get started, you should edit your post and ask more specific what you need help with and there will be a lot of people here who will help you out. But like someone said in the comments, it's not a code service. We're not building it for you. We're here to help you get in the right direction. (I know it's a pain in the beginning, and you will get confused a hundred of times. But that's the best way of learning.)
Good luck!

ios navigation routing through URL schemas

Good evening fellas,
I was looking for a routing api to help me navigate through my app using urls. for Instance If I get a schema in a notification to show the user profile I could do someting like /user/profile on the api and get the view controller with the user information.
While searching we found this lib that seems easy enough to use and straight forward
https://github.com/usepropeller/routable-ios
Yet having one option is like having none. Does anyone have any other libraries to suggest so that we can test (play) with them and stay with the one that is most valuable?
Regards,
LSonic

How can i make the parent url automatically update to a unique url when iframe loads particular content?

Okay, i'm extremely new to this sort of thing, so i am probably using incorrect terminology, but i've been trying to find an answer and can't, so i'm asking here!
I have a website made in Tumblr that opens post content inside an iframe. However, that means my parent url doesn't change according to the iframe content. Is there a way i can cause the parent url to change according to the post inside the iframe? On other sites i have just done this manually but it needs to happen automaically here.
Help! Thanks!
I think you could achieve this on a website using a trick to manually modify the address in the URL bar without reloading the page. See this question for more information. Unfortunately I am not familiar with how Tumblr works internally so I wouldn't be able to say if you can actually use this. But it seems like the only way to achieve what you want.

Track pageviews in Google Analytics on partial url of Grails application

For my Grails application I want to set up Google Analytics to track only "partial" url's. I 'll explain:
a typical Grails url consists of the following parts: domain + application-name + controller + action + id
e.g. www.mydomain.com/myapp/controller/action/12345
As far as I understand for Google Analytics the page to be tracked is identified by the entire url. For my purpose I'm not interested in the id part of the url: I want to know which actions have been performed, but I need not know for which id the action was executed.
And of course I would like a generic solution, because I have multiple controllers and multiple actions... Maybe some kind of filter stating "I want to track pages 3 levels deep (/myapp/controller/action)" would do? Or a filter stating "exclude everything from url after the last /"?
Any help would be much appreciated.
Kind regards,
Pieter
I think this issue is best solved within the realm of Google Analytics, where you can create a specific report that ignores the id-part of the url.
That way you can just use Google Analytics at its easiest and need not make any code changes to your project
There can be several approaches. First thing comes to my mind is taking one of these steps:
Using profile filters (more info)
Generating the same virtual pageviews on each action id (more info)
Using advanced segments tool with a proper condition (page url pattern match) (more info)
Each approach has its pros and cons, choosing proper one depends on the goal you are trying to achieve.
I think this question is best answered by this article.
As the other contributors suggested, I too thought the issue should be resolved in Google Analytics. I clicked around a bit and got hopelessly confused.
Solving the issue within Grails is much much easier. In short the answer is:
in the Google Analytics tracking javascript there is a
"_trackpageview" action
this action can take as parameter the url you want to track
in Grails I can simply add the stuff I want to track:
application/controller/action
my Google Analytics script is in my main template
I just use: _gaq.push(['_trackPageview','myapp/${controllerName}/${actionName}']);
("myapp" should be the name of your application)
(${controllerName} and ${actionName} are generically available
variables in the Grails views)
Hope this will help others.
Thnx for the other answers.

ASP.NET MVC Update Address Bar With Ajax Link

I'm trying to create an ajax-driven gallery where each photo in a sequence is loaded with an Ajax.Actionlink.
The user can get to any given photo by passing a parameter to the action method, eg: Gallery/Index?photo=100
The problem is that when the user is cycling through photos with the Ajax.Actionlink's the URL is no longer being updated (the way it would be during normal post-backs) so they can't copy paste from the address bar to get back to a photo.
My question is: what is the best way to solve this issue in ASP.NET MVC? One thing I was thinking of was updating the address bar with hashtags, but frankly I don't know if this is a good approach.
I could use some best-practice advice on how to solve this problem. Any suggestions would be much appreciated, thank you.
If you really want to update the address bar with each ajax update there are a couple of jquery / javascript libraries you can use as described in this blog post: http://stephenwalther.com/archive/2010/04/08/jquery-asp-net-and-browser-history
However, the best practice solution is usually not to try and fake something like this (its only going to go wrong). If you want to give your users the ability to share or link to a photo is to provide a field with the appropriate url or permalink to the url that they can copy from. Google maps has a good example of this - if you wanted to share a map with someone else.
I would look into rewriting your routes to include the photo ID in the path.
E.g., /Gallery/Index/100 instead of ?photo=100. This would be why your ActionLink methods aren't working how they should, as the querystring isn't part of the route.

Resources