...I think anytime you are running TV through functions you will have some sort of performance hit.
I think it should be just as fast as running pure php
I'm curious, we would the functions be stored?
I'm thinking they could be stored inside the database or a folder inside the manager called tvclasses. The database is cool but makes it difficult to edit and distribute shared classes. I like the idea of having a folder called vclasses where you can copy your classes to the folder and it they will be automatically registered and available for use inside the template system.
What do you think (folder or database)? I'm all for the automatic registration tvclasses folder
Would MODx ship with some common ones such as for toUpperCase() and date formatting functions?
Yes there will be a built-in base class called TVClass (or similar) will some common functions such as toDate, toInt, toFloat, toCapitalize, toSentence, toUpper and toLower. Got any more functions you would like to see as default?
From this base class you can then create custom classes similar to how you would create a php class object:
#@Name:MyTVO
#@Description: My TVO Class Object
class MyTVO extends TVClass {
// code here
function sayHello($name){
// code here -
}
}
You then save the file (e.g. mytvo.class.php) and store it inside the manager/tvclasses/ folder. When you log into the manager you will then be able to modify or create a new TV to use your "My TVO Class Object" class.
On you page you could then use [*greetings::sayHello("MODx User")*]
It's very simple indeed. You don't have to worry about the behind the backend binding stuff. All you will see is a drop down list showing the Registed TV Objects and you can just select one for your TV
PS. It's kina like changing channels on your TV - premium channels - lol