Jump to content

calendar


jimfog

Recommended Posts

I have build a calendar using PHP.

The question is by using ajax can I make it as interactive as outlook.com.

 

What I want to say, is if the reason outlook.com manages to be so interactive is maybe because is built entirely on javascript.

 

Can a PHP calendar really gets a boost if ajax is used?

Edited by jimfog
Link to comment
Share on other sites

If you're using an application online, and it doesn't use a plugin like Java or Flash, and it doesn't refresh the entire page whenever you click on anything, then it's using Javascript and ajax. It doesn't really matter that the backend work is done with PHP or not, it could be any server-side language. Look into ExtJS if you want a good Javascript interface framework that connects well with any backend that you want to build. My big applications are done entirely with the interface implemented in something like ExtJS, the PHP scripts are only for interacting with the database or other server-side work and don't even output any HTML code.

 

http://www.sencha.com/products/extjs/examples/

http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/calendar/index.html

Link to comment
Share on other sites

I am using php to produce the html output of the calendar(days, months etc).

 

Do you think this is going to pose any problem after I add ajax. I problem I mean in the interactivity of the application.

 

My intention is to be as interactive as Outook.com with js/ajax of course.

I am just think if I made I mistake to produce the html with PHP.

Link to comment
Share on other sites

If you're going for full interactivity then it makes sense to use a framework like ExtJS to have Javascript create all of the elements instead of using PHP to do that. PHP shouldn't be laying anything out, PHP is good for storing and retrieving data. Presenting that data is better left to something else. De-couple the data and interface.

Link to comment
Share on other sites

I agree with JSG. I have started moving away from mixing front and back end languages for my development and projects.

 

For the front end, I have started using Angular as the framework, utilizing Grunt as the task runner for linting, testing, assembling pages, etc. And then a simple build.xml with ANT to run the various continuous integration, deployment, and packaging tasks.

 

On the backend, I have moved more towards a RESTful API based approach, using maven-php for all the same build, CI, packaging, etc tasks and using the Slim framework to help out with the API stuff.

 

A little more work upfront, but being able to deploy a site separately from its backend dependancies has been a much more welcome workflow, and not having to mix front/back end code makes maintaining each aspect of the project that much more enjoyable.

Link to comment
Share on other sites

Ok then.

It seems I should throw away the calendar produced with PHP(meaning the output).

I intend using backbone as a framework.

The thing Is I have no idea how these restful interfaces work.

 

The question is how easy or difficult it is to learn them provided of course that I know js.

 

I will build the calendar based on what both of you mentioned.

Link to comment
Share on other sites

@justsomeguy@thescientist other than data and presentation layer separation what is the beinift of using extjs or other front end framework over traditional html-jquery-js ?

Link to comment
Share on other sites

For me, I like that AngularJS works on the concept of dependency injection which tends to supports cleaner code organization and file system structuring. It is also encourages unit testing, and provides out of the box support for things like $resource, as RESTful interface on the client side for working with RESTful API's on the backend.

Link to comment
Share on other sites

I prefer ExtJS over jQuery because of all of the interface components. They try to make it about as object-oriented as you can do with Javascript, especially with the current version. I wouldn't use all of ExtJS just to do minor interface things on an existing site, but when I'm developing a new application I prefer to start with it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...