punn / registry
There is no license information available for the latest version (dev-master) of this package.
A registry package for storing values based on keys for Laravel v4. Kind of like view::share but reachable in all MVC
This package's canonical repository appears to be gone and the package has been frozen as a result.
dev-master
2014-08-06 03:03 UTC
Requires
- php: >=5.3.0
- illuminate/support: ~4.1
This package is not auto-updated.
Last update: 2023-02-18 07:15:40 UTC
README
This package allows you to store values by user-given keys and get the values in any later MVC
Installation
- Add
"punn/registry": "dev-master"
toapp/config/app.php
in therequire
- Add
'Punn\Registry\RegistryServiceProvider',
to theproviders
array inapp/config/app.php
- Add
'Registry' => 'Punn\Registry\Facades\Registry'
to thealiases
array inapp/config/app.php
- You may have to run
composer dump-autoload
orphp composer.phar dump-autoload
inside your laravel project's root
Usage
Add/store a value
Registry::set($key, $values);
Get a value previously stored
Registry::get($key);
Examples
Simple homepage URL:
- In
links.php
, add the following:
$values = array( 'title' => 'Awesome Registry Class', 'description' => 'This is an awesome meta tag description', 'noindex' => '0' ); Registry::set('meta', $values);
- In your model/view/controller, retrieve the values you set:
$values = Registry::get('meta');
Notes
- The view::share method is a good way to store things for views to use. However, it's not accessible in additional controllers and models