Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
principino1984 Posted May 25, 2017 Posted May 25, 2017 Hello I am newbie IPS developer. I create a Plugin with Developer tool in my IPS installation. I have in my plugin the method public function configuration( &$form=null ) { if ( $form === null ) { $form = new \IPS\Helpers\Form; } $form->add( new \IPS\Helpers\Form\Text( 'example_var_1', isset( $this->configuration['example_var_1'] ) ? $this->configuration['example_var_1'] : '', FALSE) ); return $form; // $$form->add( new \IPS\Helpers\Form\XXXX( .... ) ); // return $form; } I have in render method public function render() { $this->configuration['example_var_1'] = isset($this->configuration['example_var_1']) ?$this->configuration['example_var_1']: ''; return $this->output( $this->configuration['example_var_1']); // Use $this->output( $foo, $bar ); to return a string generated by the template set in init() or manually added via $widget->template( $callback ); // Note you MUST route output through $this->output() rather than calling \IPS\Theme::i()->getTemplate() because of the way widgets are cached } How I could retrieve variable example_var_1 in myplugin.phtml file ?
newbie LAC Posted May 26, 2017 Posted May 26, 2017 Hello, Fisrt line of myplugin.phtml file <ips:template parameters="$var1" /> $var1 is $this->configuration['example_var_1']
Recommended Posts
Archived
This topic is now archived and is closed to further replies.