Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Put an echo in function execute of a box


goldoi

Recommended Posts

Hello everyone,

I have the following code, how can i inject the echo on line 1 in $data ? Thx for your help

 

<?


echo $categories_menu;
class bm_flyout {
   var $code = 'bm_flyout';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;

..........

   function execute() {
  global $oscTemplate;	  
  $data = '<div class="ui-widget infoBoxContainer">' .
		  '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_FLYOUT_TITLE . '</div>' .
		  '  <div class="ui-widget-content infoBoxContents">' . '<tr><td>' . $categories_menu . '</td></tr>'. '</div>' .
		  '</div>';

	 $oscTemplate->addBlock($data, $this->group);
   }

Link to comment
Share on other sites

What do you want to echo there and why?

 

The complete content of $data will be echoed among the rest of anything else (other $datas) belong to $this->group, I guess it is column left or right

Link to comment
Share on other sites

I wanto to echo $categories_menu in $data instead of on the first line. I want to put dynamenu output in $data because i use osc 2.3.1.

See http://dormitoryuk.com/shop for détails. I use this for testing the code:

<?


class bm_flyout {
   var $code = 'bm_flyout';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;
   private $categories_menu; // uonly for bm_flyout class

    public function setCatMenu( $var ) {
    $this->categories_menu = $var;
		    echo '<pre>Validate method '.__METHODE__.'<br />';
		    var_dump($this->categories_menu);
		    echo '</pre>';
   }    
   function bm_flyout() {
// i have removed some code here
  }
   }
   public function execute() {
		    global $oscTemplate;	  
		    $data = '<div class="ui-widget infoBoxContainer">' .
		    '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_FLYOUT_TITLE . '</div>' .
		    '  <div class="ui-widget-content infoBoxContents">' . '<tr><td>' . $this->categories_menu . '</td></tr>'
		    . '</div>' .
		    '</div>';
		    echo '<pre>Validate de $data in method '.__METHODE__.'<br />';
		    var_dump($data);  
		    echo '</pre>';
    $oscTemplate->addBlock($data, $this->group);
   }

   function isEnabled() {
  return $this->enabled;
   }

var_dump($this->categories_menu); works as you can see but var_dump($data); doesn't inject $this->categories_menu.

Thx for your help!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...