-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agnostic Package #5
Comments
That would be great! I'd like to use this package for Laravel 4.2 actually. |
Quando finalizarmos os testes vou pra essa :D |
All you would have to do is remove all of the laravel helper functions (like array_forget() and array_get()) -- or better yet, include those functions in your own helpers.php file and include them via composer.json like:
but once all of the helper functions are taken care of, the package is already agnostic. Someone not using Laravel could simply not register the service provider or alias, and use: <?php
use Artesaos\SEOTools\SEOTools as SEO;
class SomeClass
{
public function generateView()
{
SEO::setTitle('Home')->setDescription('Welcome to my website!');
echo SEO::generate();
}
} obviously, that's an odd example, but it shows that a user can already use the package without Laravel. This is because the only thing Laravel is used for is setting up the Aliases and config (I am remove the config in my next pull, so if that is accepted, you won't have to worry about the config) |
^^ As a matter of fact, someone using Laravel can even use the package without the Service Provider (once the config is gone) |
Transforming the package in a package that does not depend on Laravel.
Transformar o pacote em um pacote que não dependa do Laravel.
The text was updated successfully, but these errors were encountered: