[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Location of JSON file within CodeIgniter for use as eventSource with fullCalendar jQuery plugin

Posted on 2014-03-13
2
Medium Priority
?
2,273 Views
Last Modified: 2014-03-13
I am trying to generate some JSON to store information about calendar events for use in the fullCalendar jQuery plugin.  The plugin documentation provides that the calendar is able to fetch events from a JSON feed:

$('#calendar').fullCalendar({

    eventSources: [

        // your event source
        {
            url: '/myfeed.php', // use the `url` property
            color: 'yellow',    // an option!
            textColor: 'black'  // an option!
        }

        // any other sources...

    ]

});

Open in new window


My question is:  Where does the myfeed.php file go if I am using CodeIgniter?  If I put the file off the root of the site as in `http://mysite/myfeed.php` then I am not able to query the database, presumably because the file is outside of the CodeIgniter application folder.  If the myfeed.php file needs to be inside the CodeIgniter application folder, then where does it go and how do I modify the URL parameter above to reflect the new location?

Thanks.
0
Comment
Question by:DanielAttard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Accepted Solution

by:
DanielAttard earned 0 total points
ID: 39928314
The answer to this question I discovered by realizing that it was not a "view" that needed to be loaded, but rather it was simply a calculation, or method, if you will. All I had to do was to move the calculation code that was in myfeed.php and put it into a controller and then a method. After I did that, it was simply a matter of updating the url parameter as follows:

$('#calendar').fullCalendar({
eventSources: [
{
    url:  '/myController/myMethod',  <-- THIS WORKS !!
    color: '#DBBE00',     
    textColor: '#000000' 
}
],    
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: false
});

Open in new window

Happy to report that I managed to figure this one out myself.
0
 

Author Closing Comment

by:DanielAttard
ID: 39928316
Solved this problem on my own.  </BackPatting>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question