Forums / Developer / Where's my result?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Where's my result?

Author Message

Aleksander Lech

Sunday 14 August 2005 10:53:18 am

hello,
here's part of my custom extension code:

include_once( 'kernel/common/template.php' );

$tpl =& templateInit();

$Result = array();
$Result['content'] =& $tpl->fetch( 'design:mymod/overview.tpl' );
$Result['path'] = array( array( 'url' => false,
                                'text' => 'MyMod' ) );
                                

   include_once( 'lib/ezdb/classes/ezdb.php' );  
   $db =& eZDB::instance();
   $Result['wynik'] =& $db->arrayQuery( 'SELECT * FROM firma WHERE id<2',
                            array( 'offset' => 0, 'limit' => 10 ) );


Result of the query is in $Result['wynik'] array. How to get it from there and use it in template?

Regards
Aleksander

Gabriel R.

Sunday 14 August 2005 11:39:58 am

use the template 'setVariable' function:

php extension code

...

$db =& eZDB::instance();
   $wynik =& $db->arrayQuery( 'SELECT * FROM firma WHERE id<2',
                            array( 'offset' => 0, 'limit' => 10 ) );

$tpl->setVariable( 'wynik', $wynik );

template example

my result: {$wynik|attribute(show)}