Include in Block Vars

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
harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Include in Block Vars

Postby harmlessgoat22 » 10 Jun 2008, 13:08

If you include a file while in a block vars loop, and that file has more things to do with that loop, will those things be parsed?

That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever

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: Include in Block Vars

Postby igorw » 10 Jun 2008, 13:12

You cannot use block vars in an included template file, if that's what you mean.

- we're poor!

BetaDevil
Supporter
Supporter
Posts: 27
Joined: 01 Sep 2007, 12:27
Real name: Tim
[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: Include in Block Vars

Postby BetaDevil » 10 Jun 2008, 15:28

I think it won't work because (if I'm correct) the file will be included more than 1 times which gives an error in PHP because PHP can only include files once.

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: Include in Block Vars

Postby igorw » 10 Jun 2008, 15:36

PHP can include files multiple times, that's not the problem. The problem is that the template variables are not parsed if they're not in the same file as the block.

- we're poor!

Masterhand
New member
New member
Posts: 12
Joined: 05 Jun 2008, 23:42
Real name: Austin
Location: The 145,721th dimenson
Contact:

Re: Include in Block Vars

Postby Masterhand » 10 Jun 2008, 16:01

~-If at first you don't succeed, hide all evidence that you tried-~

harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Re: Include in Block Vars

Postby harmlessgoat22 » 11 Jun 2008, 01:33

You can't use include_once in a template...

That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever

User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Include in Block Vars

Postby Obsidian » 11 Jun 2008, 04:10


harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Re: Include in Block Vars

Postby harmlessgoat22 » 11 Jun 2008, 17:28

You don't get what I'm asking. I'm asking about including a template with block vars in it.

That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever


[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 19 guests