Il codice qui sotto dice tutto ...laravel 4: Passaggio di dati da fare per il fornitore di servizi
// routes.php
App::make('SimpleGeo',array('test')); <- passing array('test')
// SimpleGeoServiceProvider.php
public function register()
{
$this->app['SimpleGeo'] = $this->app->share(function($app)
{
return new SimpleGeo($what_goes_here);
});
}
// SimpleGeo.php
class SimpleGeo
{
protected $_test;
public function __construct($test) <- need array('test')
{
$this->_test = $test;
}
public function getTest()
{
return $this->_test;
}
}
Ciao @schmaltz hai raggiunto una risposta per la tua domanda? Sto avendo lo stesso problema e sto cercando una soluzione in quanto la mia applicazione utilizza un'architettura simile alla tua .. – Omranic