From: Brad B. <bbu...@uc...> - 2013-08-27 17:39:04
|
Fantastic, I'm on the right path! I'm doing something very similar in the theme.config.php: 'ConditionalLinks' => function ($sm) { $config = $sm->getServiceLocator()->get('VuFind\Config')->get('config'); $hp = !isset($config->Site->url) ? false : $config->Site->url; return new \VuFindLocal\View\Helper\phoenix\ConditionalLinks($hp); }, The only thing I can see that might be different is that I'm trying to pass it to a specific function in the call to the view helper: *$this->ConditionalLinks()->recallLink($hp);* I've also tried: $this->ConditionalLinks($hp)->recallLink(); and $this->ConditionalLinks($hp)->recallLink($hp); in my troubleshooting. On 8/27/13 12:31 PM, Demian Katz wrote: > If you use a factory to construct your view helper in your theme's theme.config.php file, it shouldn't be too hard to push in configuration values... there are several existing view helpers that do this. For example (from the root theme): > > 'addthis' => function ($sm) { > $config = $sm->getServiceLocator()->get('VuFind\Config')->get('config'); > return new \VuFind\View\Helper\Root\AddThis( > isset($config->AddThis->key) ? $config->AddThis->key : false > ); > }, > > This pulls the [AddThis] / key value from config.ini and pushes it into the AddThis helper. > > Feel free to share code if you have something similar but it isn't working for you -- maybe it's just a slightly misaligned configuration array or something similar. > > - Demian > >> -----Original Message----- >> From: Brad Busenius [mailto:bbu...@uc...] >> Sent: Tuesday, August 27, 2013 1:13 PM >> To: vuf...@li... >> Subject: [VuFind-Tech] ini config values in custom view helper >> >> I'm having a terrible time trying to pass config values from the .ini >> files into a custom view helper in my custom theme. Is this a >> non-standard practice? What's the best way to go about this? As always, >> your help is greatly appreciated. >> >> Brad Busenius >> >> ------------------------------------------------------------------------------ >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> Discover the easy way to master current and previous Microsoft technologies >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> tutorial videos with LearnDevNow. Subscribe today and save! >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> _______________________________________________ >> Vufind-tech mailing list >> Vuf...@li... >> https://lists.sourceforge.net/lists/listinfo/vufind-tech |