Not sure what kind of values you are setting but maybe $_GET would do the job ? You could get values like so Input::get('value').
I have an object that I want to be accessible within controllers and views.
Global variables are bad, you should refactor your code, perhaps to a class with all the ads functionality.
Knowing that, the answer to your question: the laravel way of sharing something with all the application is binding it to the IoC. It's supposed to be used for binding classes and dependency injection but can be also used to store an scalar value.
http://laravel.com/docs/ioc#basic-usage
To bind a shared component:
App::singleton('foo', function($app)
{
return 'foooooo';
});
To use it in any part of your app:
echo App::make('foo'); // will print 'foooooo'
Thanks! I finally decided to use Laravel's IoC!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community