[TYPO3-dev] My first (for me) advanced extension
Wolfgang Klinger
wolfgang at stufenlos.net
Fri Mar 17 15:03:14 CET 2006
*hiya!*
On Fri, 17 Mar 2006, Brian Bendtsen wrote the following:
> > > - Do I place this function in the class_myextension_pi1.php file or
> > > do I have to create another?
> >
> >
> > You don't have to put it in class.myextension_pi1.php but that would be
> > the most obvious thing to do (not sure I understand this question).
>
> Thank you, that was very helpfull.
>
> About that question. I have my form now and Im not sure what to put in
> the action attribute. Im pretty sure that I just call
> class_myextension_pi1.php, but what parameters is needed to tell the
> script to go to the function that will write something to my database table.
(1) use the Smarty template engine, believe me this is the best way to
do templating, don't even start with this TYPO3 templating stuff
http://smarty.php.net/
http://typo3.org/extensions/repository/search/smarty/1.0.2/
(2) e.g.
----
$action = t3lib_div::linkThisScript(Array());
----
or use the link methods in tslib_pibase (take a look at that class).
and use something like:
----
<input type="hidden" name="tx_myext_pi1[action]" value="save" />
----
you can access this value with
----
$this->piVars['action']
----
in your plugin.
(3)
You can use the pi1 method as "controller" and delegate to other classes
as well, simply include them with
----
require_once(t3lib_extMgm::extPath('tx_myext').'lib/my_special_class.php');
----
HTH, if not don't hesitate to ask again.
bye
Wolfgang
More information about the TYPO3-dev
mailing list