Jump to content

wierd mistake


raja9911

Recommended Posts

Hey

 

I just wrote a very small php code, but a wierd mistake is coming up

 

In the beginning of the div a "}" appers, and i simply do not understand why comes

 

{* product_overallmenu.tpl *}
{load_new_product_sidebar assign="new_product_sidebar"}
{* start product overallmenu *}

<h2><center>New products</h2>
		<a href="http://localhost/shop/index.php?ProductMenu=1&News=1">Click here to see all the new products</a><br><br>
<b>
      
      <font size="1,5">
      {section name=x loop=$new_product_sidebar->mSidebarProducts}
        {$new_product_sidebar->mSidebarProducts[x].name}<br>
        <img src='product_images/{$new_product_sidebar->mSidebarProducts[x].image_file_1}'  alt="" width="100" height="100"><br>
        price: {$new_product_sidebar->mSidebarProducts[x].price}<br><br>
        
      {/section}
</center></b></font>
{* end new_product_sidebar *}

 

code for the function load file

<?php
/* smarty plugin function that gets called when the
load_admin_products function plugin is loaded from a template */
function smarty_function_load_new_product_sidebar($params, $smarty)
{
  $new_product = new News();
  $new_product->init();
  
  // assign template variable
  $smarty->assign($params['assign'], $new_product);
}
//class that deals with products administration from a specific category
class News
{	
public $mSidebarProducts;
private $mBoCatelog;

function __construct()
{
$this->mBoCatalog = new BoCatalog();
}

  function init()
  {
    
    $this->mSidebarProducts = $this->mBoCatalog->GetProductNewsSidebar();
    
  }
}
?>	
}

Link to comment
https://forums.phpfreaks.com/topic/60354-wierd-mistake/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.