yiisoft/yii2-smarty

Not compatible with Smarty 2

antonmarin opened this issue · 14 comments

What steps will reproduce the problem?

What's expected?

What do you get instead?

Additional info

No setCompileDir method

Q A
Yii vesion
PHP version
Operating system

It is. Should work with either 2.6 or 3. If you have a specific problem, please elaborate it.

ViewRenderer calls setCompileDir() in init(), which doesn't exist in Smarty. Tested with Smarty 2.6.30

Yes. It seems to be added in 3.1. Before it was $smarty->compile_dir = "foo";.

Fixed.

Don't think that it is enough. For example: version 2.6.24. Class Smarty doesn't have method setCacheDir(). What about adapter for v2?

cebe commented

@samdark just tried to fix support for v2 but it seems nearly every function of the ViewRenderer and Extension class depend on something that only works in smarty 3. Not sure there is any sense in supporting 2.x I have committed my changes to #20 if someone wants to give it a try.

Actually that's a very good question. @antonmarin why do you need v2 supported? Seems v3 is stable and requirements aren't higher than Yii ones...

Legacy support ((

So you do support it already somehow? Probably you can share some code?

I'm going to create adapter for 2nd version this weekend. Our current solution is ugly

Please pick up travis changes @cebe proposed so test run against both versions.

Yep, thanks

Well. I need some help )) Any ideas about ->registerClass method?

Looks like there's no way to implement it.