dwoo-project / dwoo

[UNMAINTAINED] php template engine
http://dwoo.org
GNU Lesser General Public License v3.0
167 stars 58 forks source link

Function include #18

Open Hikari974 opened 10 years ago

Hikari974 commented 10 years ago

Bug using function {include} 2 times in the same template. Only if the compiled folder is empty.

The first include use Autoloader::loadFunction, the second use Autoloader::__autoloadClass and send an error : Cannot redeclare Dwoo\Plugins\Functions\functionInclude().

The second time the function exist but not the class.

I solve the problem with require_once in Autoloader::__autoloadClass.

emulienfou commented 10 years ago

Update full dwoo source and tell me if you have the same bug ?

Hikari974 commented 10 years ago

The problem is solved, but now I have some issue with my autoloader(priority I guess). I work on it and make you a feed back.

MartinMuzatko commented 10 years ago

I got the same issue.

postaczech commented 10 years ago

I got the same issue with include in templates ... Cannot redeclare Dwoo\Plugins\Functions\functionInclude().

emulienfou commented 10 years ago

First of all, I think you need to update your dwoo's sources, because functionInclude as now a first letter as uppercase such as FunctionInclude.

All the tests I've done, I can't reproduce the problem in my environment, so can you tell me if you use .use the dwoo's autoloader or do you use your personal autoloader?

Thanks!

postaczech commented 10 years ago

I use latest version of Dwoo and I use standard Dwoo Autoloader. When I want include two tpl files in my template, I see error:

Example 1 :

page.tpl

{include "another.tpl"}

Example 2:

page.tpl

{include "another.tpl"} {include "another.tpl"}

I see error, Fatal error: Cannot redeclare Dwoo\Plugins\Functions\functionInclude() (previously declared in C:\wamp\www\modern\libs\Dwoo\Plugins\Functions\functionInclude.php:29) in C:\wamp\www\modern\libs\Dwoo\Plugins\Functions\functionInclude.php on line 88

emulienfou commented 8 years ago

Need to be tested in final 1.3.0