Re: Can't find my error
| From: | David McGlone | Date: | Wed, 05 May 2010 17:04:43 +0000 |
| Subject: | Re: Can't find my error | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-304913@lists.php.net to get a copy of this message | ||
On Wednesday 05 May 2010 12:59:00 Peter Lind wrote:
> On 5 May 2010 18:55, David McGlone <david@dmcentral.net> wrote:
> > I've checked and checked and re-checked and I can't figure out what I've
> > done wrong. I'm getting a parse error:
> >
> > Parse error: syntax error, unexpected T_VARIABLE in
> > /home/david/www/Joe/current/presentation/smarty_plugins/function.load_pro
> >ducts_list.php on line 27.
> >
> > Can anyone spot my error? I'd appreciate the help.
> >
> > Here is the function.load_products_list.php file:
> >
> > 1. <?php
> > 2. function smarty_function_load_products_list($params, $smarty)
> > 3. {
> > 4. $products_list = new $ProductsList();
> > 5. $products_list->init();
> > 6.
> > 7. //assign the template variable
> > 8. $smarty->assign($params['assign'], $products_list);
> > 9. }
> > 10.
> > 11. //Manage the products list
> > 12. class ProductsList
> > 13. {
> > 14. public $mProducts;
> > 15. public $mSelectedProduct;
> > 16.
> > 17. private $mBoCatalog;
> > 18.
> > 19. //constructor initializes business tier object
> > 20. //and reads query string parameter
> > 21. function __construct()
> > 22. {
> > 23. //creating the middle tier object
> > 24. $this->mBoCatalog = new BoCatalog();
> > 25. //if ProductID exists in the query string, we're viewing
> > a product. 26. if(isset($_GET['ProductID']))
> > 27. $this->mSelectedProduct = (init)$_GET['ProductID'];
>
> pretty sure (init) is not a valid cast ...
Your hunch is correct. LOL Still can't believe I overlooked that so many
times.
--
Blessings,
David M.