if you’re experienced with php then you can write your php as snippets, or call php files.
one way is to use documents to hold your php.
as for passing variables, if they’re forms, use $_GET or $_POST to get the vars from the form, or sometimes I even add values onto the url (&var=something). When you’ve processed the forum, you can either call a page that you have created in modx.
Basically, Snippets are what you want to be looking at. Have a look at some that have been developed, it will give you a good idea of how the fit into the framework.
in snippets vars can be passed to them from when you call the snippet.
so basically, if you know php, you don’t really need to come at things in a different way at all.
i find the DBAPI great with modx, as it enables me to use the DB, the structure that modx has set up (the framework) and then write code how I want to. Generally that includes a fair combination of javascript, php and to some extent (depending on the site) flash AS.
Well, talk about trying to make things more complicated than need be! I got my form working with no problem at all. Many thanks to both of you for your fast and helpful advice. No doubt I’ll be back with a few more questions in the future.
All the best.
-
MODX Staff
- 730 Posts
If you want start using some of the object-oriented goodness that forms the core of the not-too-distant future MODx, check out xPDO.
http://www.xpdo.org/ Get your head around (if it’s not already.. I don’t mean to assume ;-) modelling and the object-relational bridge concept. You can model your web applications with xPDO and use it in your 0.9.6.x sites today. I’ve done a number of projects like this already. xPDO also plays very nicely with ajax interfaces like extjs, YUI etc etc. Without explicitly setting out to learn it, I’ve slowly come around to a near MVC approach using xPDO with 0.9.6.x. Basically, xPDO is the M (model), templates and chunks are the V (views) and snippets are the C (controllers). (A tad oversimplified of course

I can’t wait to start building real apps in 0.9.7. So close I can smell it! (or is that my dog?)
-
☆ A M B ☆
- 24,524 Posts
Yeah, sure, blame the dog