Odd assign_block_vars problem

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
comkid
New member
New member
Posts: 18
Joined: 28 Jun 2009, 11:32
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Odd assign_block_vars problem

Postby comkid » 28 Mar 2010, 21:03


User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Odd assign_block_vars problem

Postby igorw » 29 Mar 2010, 18:25

And why exactly are you using <!-- PHP --> tags? Use normal template variables.

- we're poor!

imkingdavid
Supporter
Supporter
Posts: 32
Joined: 12 Aug 2009, 16:16
Real name: David
Contact:

Re: Odd assign_block_vars problem

Postby imkingdavid » 29 Mar 2010, 19:28

phpBB.com Development Team Member | |
Please do NOT contact for support via PM or email.

User avatar
Thoul
New member
New member
Posts: 14
Joined: 23 May 2007, 22:21
Location: USA
Contact:

Re: Odd assign_block_vars problem

Postby Thoul » 16 Apr 2010, 14:15

I agree you should just do it the usual way, but here's the reason your approach didn't work. Template files are parsed inside a function of the template class. Inside the scope of that function, $template isn't set. To do it the way you were trying, instead of $template->_rootref, you'd have to use $this->_rootref.



[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 3 guests