Creating a Calendar in Symfony

只愿长相守 提交于 2019-12-06 13:00:25

问题


I'm using symfony 1.4 for my web project.

I have the following problem (or opportunity): I need to create a calendar where the "common" user has only the ability to see (or read) the date and time of the events and the "admin" user can edit, add and remove new events. So it's basically a google calendar type of thing where I have to different permissions, read and read, write, delete.

Also I need to be able to fully customize a calendar style so that It matches my css.

How would your approach this problem? I've been trying to find the best plugin for this endeavor but I haven't found one that with a good documentation

Thanks in advance!


回答1:


I would suggest to build 2 applications for that.

  1. frontend (read/see)
  2. backend (admin)

Just go with the normal symfony approach.. define your models, generate frontend (inkl. modules). There you can adjust you templates and css.

Practicle open book where you can choose the topics you need

Then use the admin-generator to get the backend application. You can customize behaviours and styling of course.




回答2:


I recommend FullCalendar jQuery plugin. It gives you very nice JavaScript calendar with drag&drop support. You can use your own CSS style.

On the server side create symfony actions that will return data to FullCalendar API. Just serialize the data to JSON Event Object.

Of course you should use symfony security component to restrict read/write access. Show only those events that users should be able to see. And don't let them access write actions if they don't have write permission.

To manage event data you can either create backend admin module or display your own form when user click on calendar (like Google Calendar does). If you like the second approach then you have to handle it in JavaScript.



来源:https://stackoverflow.com/questions/4208354/creating-a-calendar-in-symfony

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!