<?php
class actions_hello {
function handle(&$params){
$app =& Dataface_Application::getInstance(); // reference to Dataface_Application object
$auth =& Dataface_AuthenticationTool::getInstance(); // reference to Dataface_Authentication object
$request =& $app->getQuery(); // Request vars: e.g. [-table]=>'Students', [-action]=>'hello'
$user =& $auth->getLoggedInUser(); // Dataface_Record object of currently logged in user.
$current_tablename =& $request['-table'];
$current_record =& $app->getRecord(); // Currently selected record (Dataface_Record object)
$results =& $app->getResultSet(); // Current found set (Dataface_QueryTool object).
// Iterating through the results
$it =& $results->iterator();
while ($it->hasNext() ){
$record =& $it->next(); // $record is a Dataface_Record object
print_r($record->strvals());
unset($record); // necessary so that PHP doesn't just keep overwriting the same object.
}
// Perform a custom SQL Query:
$res = mysql_query("select * from foo inner join bar on foo.x=bar.y", $app->db());
// .. etc ...
// Obtain parameters from the actions.ini file for this action:
$template_name = $params['action']['template']; // The value of the template parameter
df_display(array(), $template_name); // this form allows you to change the template to use by modifying the actions.ini file.
}
}
?>
--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/5a7101bf-067c-4cd2-aea9-200166622854%40googlegroups.com.
The same url with -action=list displays the list of items in the first table of the database...
--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/bb37043e-8b57-4422-9e1f-66776d02545c%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/71b60af0-4fc5-40d9-8870-05d866f58d4a%40googlegroups.com.