Comments (26)
or PSR-4 👍
from smarty.
PSR-0 works for everything that does not use namespaces, but can be made to conform to a specific file layout.
PSR-4 requires namespaces. Smarty doesn't use namespaces. So PSR-4 isn't available.
Switching Smarty to namespaces will be an incompatible change, which should be released as a new major version, i.e. Smarty 4.
from smarty.
I agree that PSR-0 looks for now to be the better solution. But this also requires changes in the folder structure and the renaming of some classes. This will create some backward compatibility issues.
For that reason it is not a good idea to implement it in 3.1.
I have done it in my local 3.2 version.
I expect to provide an alpha release of 3.2 within the next 2 month.
from smarty.
exactly.
from smarty.
Looking forward to that.
from smarty.
👍
from smarty.
@hlohaus PSR-4 would also work !
from smarty.
PSR-0 autoloading is deprecated. So we will look into PSR-4 compatibility.
This will require a change in folder structure and maybe the renaming of some classes.
I did put this on the TODO list for one of the next releases.
from smarty.
ok
from smarty.
PSR-4 ? seriously ?
then don't forget to introduce nameapace with a "vendor" top level.
from smarty.
+1 with @SvenRtbg
from smarty.
from smarty.
Thats why i suggested plain PSR-0
from smarty.
Hi,
I have tried to implement psr in smarty but it seems not to work even if I have no error in my log.
Have you a psr compatible version released ?
Thanks
from smarty.
@pm-j Smarty provides it's own autoloader in addition to the Composer definition. Have you considered using it?
from smarty.
@uwetews What is the current target date for 3.2 with namespaces?
from smarty.
Smarty 3.2 cannot have namespaces because that would be an incompatible change.
from smarty.
Any updates on getting into PSR-4 ?
from smarty.
PSR-4 requires namespacing, this is best left to Smarty 3.2.
from smarty.
3yrs down the line , any update on this ?
from smarty.
The autoloading used with Smarty causes troubles with AspectMock. Could you please conform to PSR-0 for now, and then do PSR-4 in a major release? Thank you for all the hard work.
from smarty.
If AspectMock have issues with standard autoloading schemes, raise it with that AspectMock thing.
from smarty.
It does not appear to me that Smarty uses standard autoloading. If I am wrong, please correct me. But, I can think of three nonstandard things right now.
from smarty.
It does, since December 2018.
from smarty.
Shouldn't be this issue closed?
from smarty.
Old issue- waiting for PSR 4 support
from smarty.
Related Issues (20)
- Fatal error: Uncaught --> Smarty: Unable to write file [file_path] thrown in C:\[project_path]\vendor\smarty\smarty\src\Smarty.php on line 1732 HOT 7
- Request for `prependTemplateDir()` or more options with `addTemplateDir()` - weight, duplicate handling HOT 9
- undefined extension class 'Smarty_Internal_Method_Get_Template_Vars' HOT 1
- Is it possible patch v2 for PHP8 instead of migrating to v4+? HOT 1
- default modifier ignores nocache on variables
- Smarty registered classes check prevents use of class constants to avoid typo bugs in templates HOT 2
- 4.5.3: Function whitelist via Smarty_Security is being ignored
- Misleading error messages with {capture}
- Smarty v5 Error: {section} Tag First Argument Type Mismatch when opening and closing tag on NoCache HOT 3
- Help with Smarty dateformat modifier - change to dd/mm/yyyy HOT 5
- Error: For loop not working when using extends resource type HOT 1
- Smarty Not Working HOT 3
- XAXOKPIMUE
- How to use '|' as '||'? HOT 1
- How it's possible to modifiy tpl_vars subkey inside a plugin function HOT 3
- Feature request. Able to run multiple versions HOT 4
- how to use loadFilter() ? HOT 5
- Unable to override built-in modifiers. HOT 2
- unknown modifier 'var_dump' and unknown modifier 'print_r' HOT 1
- Composer and external dependencies defeat the point of using Smarty over any off-the-shelf framework. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarty.