In fact that I am too poor to buy a server to run my website, but I want to run cron auto, so I use ajax to do it! :P

 

In the file of the layout, add the code as below:

代码
<script type="text/javascript">
$(document).ready(
function(){
$.ajax({
type:
'GET',
url:
"<?php echo Yii::app()->createUrl("/site/cron");?>",
data:
''
});
});
</script>

 

in the path /site/cron, you can write some code to do what you want. :)

 

Have fun with Yii!

相关文章:

  • 2022-12-23
  • 2021-05-25
  • 2021-06-26
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2021-10-14
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
相关资源
相似解决方案