Return component value from database params - Joomla! Forum - community, help and support


i have built component backend admin tool store email address parameter component.

i can store , retrieve parameter database in backend, however, cannot return front end populate form field.

the value stored

email=myname@myemailaddress.com

in backend

in front end wish return it. code i've got is:

com_eventbook/eventbook.php

code: select all

defined( '_valid_mos' ) or die( 'direct access location not allowed.' );

// include support libraries
require_once( $mainframe->getpath( 'front_html' ) );
require_once( $mosconfig_absolute_path.'/includes/phpmailer/class.phpmailer.php' );

// handle task
$task = mosgetparam( $_request, 'task', '' );
$event_id = intval( mosgetparam( $_request ,'event_id', 0 ) );

$menu =& new mosmenu( $database );
$menu->load( '33' );
$params =& new mosparameters( $menu->params );

$params->def( 'email', '' );

switch ($task) {
   case 'submit':
      submitevent( $params );
      break;
   default:
      bookevent( $event_id, $params );
      break;
}


however, when try populate field it's empty

code: select all

global $params;
echo $params->get( 'email', '');


how should doing this? i've followed code at:

http://help.joomla.org/content/view/28/125/

but can't work.

this line right here...

code: select all

$params->def( 'email', '' );

...is blanking out value.





Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'