Addon development

Permalink 1 user found helpful
Hello all,

i am preparing a addon for submit it to marketplace...but in blocks edit.php file does not shows selected value from database...because of $this->inc...

if i use include instead of $this->inc then its works fine...
i can't understand the problem....any help would be appreciated..

Code in edit.php
<?php   
defined('C5_EXECUTE') or die(_("Access Denied."));
$fblikeObj=$controller;
?>
<?php   include($this->getBlockPath() .'/form_setup_html.php'); ?>


thanks in advance

Regards
jupiter

Jupiter
 
goutnet replied on at Permalink Best Answer Reply
Well, include will pass the defined variables where as $this->inc will not.

You need to pass an array as second parameter to define those vars :

<?php
$this->inc( 'myfile.php', array( 'fbLikeObj' => $fbLikeObj ) );


If you have too many variables, you can also do this :

<?php
$this->inc( 'myfile.php', get_defined_vars() );
Jupiter replied on at Permalink Reply
Jupiter
Thanks...works perfectly...