Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5840249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:42:51+00:00 2026-05-22T11:42:51+00:00

I am trying to get my script to generate an iCalendar, but mac calendar

  • 0

I am trying to get my script to generate an iCalendar, but mac calendar program keeps telling me the data is invalid. I’m using cakephp. Here’s what I have — any clues?:

function webcal() {
    Configure::write('debug', 0); 
    $this->autoRender = false; 
    echo header( 'Content-Type: text/calendar; charset=utf-8' );  
    ?>
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:20110514T170000Z
DTEND:20110515T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
    <?php
    exit(200);      
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:42:52+00:00Added an answer on May 22, 2026 at 11:42 am

    is this in your controller? why not put it in a seperate “blank” layout instead of trying to hack the controller to do something it’s not meant to do.

    // controller code
    function webcal(){
        Configure::write('debug', 0); 
        echo header( 'Content-Type: text/calendar; charset=utf-8' );  
        $this->layout = 'blank' // depending on what version of cakephp you're using this might be different
    }
    
    // layout code in /app/views/layout/blank.ctp
    echo $content_for_layout;
    
    // view code in /app/views/<controller>/webcal.ctp
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//hacksw/handcal//NONSGML v1.0//EN
    BEGIN:VEVENT
    UID:uid1@example.com
    DTSTAMP:19970714T170000Z
    ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
    DTSTART:20110514T170000Z
    DTEND:20110515T035959Z
    SUMMARY:Bastille Day Party
    END:VEVENT
    END:VCALENDAR
    

    don’t forget to pass the view any variables you may need with $this->set()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to generate pdf using Dompdf. I have the following script for
I'm using a script i found to generate thumbnails, but i'm getting an error
I'm trying to generate characters in different encodings using MySQL. My script looks like
I am trying to get this script to work. it opens up a directry
I've been trying to get a script that inserts a div of text after
I am currently trying to get a script to write output from other started
Hi I am trying to get this script to show random colours one after
I'm trying to get a bash script setup so it'll move files up to
I'm trying to get a Ruby script to download a file off a server,
I've been having real problems trying to get a ruby script to run through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.