punn / registry
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. Email us for help if needed.
Installs: 109
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
pkg:composer/punn/registry
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.phpin therequire - Add
'Punn\Registry\RegistryServiceProvider',to theprovidersarray inapp/config/app.php - Add
'Registry' => 'Punn\Registry\Facades\Registry'to thealiasesarray inapp/config/app.php - You may have to run
composer dump-autoloadorphp composer.phar dump-autoloadinside 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