我对 Joomla 中的 Cron Job 不是很熟悉。我已经从组件创建者创建了自定义组件。我创建了两个字段 1. Title 和 2.Cron。现在我想在 Cron(Date field) 和当前日期匹配时禁用该标题。
如果有人可以帮助我,我将不胜感激。
谢谢,马南
Create a function in the component controller file in the controller frontend let say myCornTask
let say your component name is com_myform
so modify frontend controller file like this
<?php
class MyFormController extends JController{
public function myCornTask(){
$app=JFactory::getApplication();
$today=date('Y-m-d');
$db=JFactory::getDBO();
$query="UPDATE `#__my_form_table` SET `state`=0 WHERE `date`='$today'";
$db->setQuery($query);
$db->query();
$app->close();
}
}
?>
/** * Activate Corn JOB From CPANEL */ Set Corn JOB Once in a day and URL will be
http://yoursite.com/index.php?option=com_myform&task=myCornTask
problem in understanding please reply