Code Monkey home page Code Monkey logo

icalendar's Introduction

PHPFUI Tests Latest Packagist release

PHP Wrapper for the Foundation CSS Framework

PHPFUI, PHP Foundation User Interface, is a modern PHP library that produces HTML formated for Foundation. It does everything you need for a fully functional Foundation page, with the power of an OO language. It currently uses Foundation 6.6.

"I was surprised that people were prepared to write HTML. In my initial requirements for this thing, I had assumed, as an absolute pre-condition, that nobody would have to do HTML or deal with URLs. If you use the original World Wide Web program, you never see a URL or have to deal with HTML. You're presented with the raw information. You then input more information. So you are linking information to information--like using a word processor. That was a surprise to me--that people were prepared to painstakingly write HTML."

Sir Tim Berners-Lee, inventor of the World Wide Web

Using PHPFUI for view output will produce 100% valid HTML and insulate you from future changes to Foundation, your custom HMTL layouts, CSS and JS library changes. You write to an abstract concept (I want a checkbox here), and the library will output a checkbox formatted for Foundation. You can inherit from CheckBox and add your own take on a checkbox, and when the graphic designer decides they have the most awesome checkbox ever, you simply change your CheckBox class, and it is changed on every page system wide.

Don't write HTML by hand!

Usage

namespace PHPFUI;
$page = new Page();
$form = new Form($page);
$fieldset = new FieldSet('A basic input form');
$time = new Input\Time($page, 'time', 'Enter A Time in 15 minute increments');
$time->setRequired();
$date = new Input\Date($page, 'date', 'Pick A Date');
$fieldset->add(new MultiColumn($time, $date));
$fieldset->add(new Input\TextArea('text', 'Enter some text'));
$fieldset->add(new Submit());
$form->add($fieldset);
$page->add($form);
$page->addStyleSheet('/css/styles.css');
echo $page;

Installation Instructions

composer require phpfui/phpfui

Then run update.php from the vendor/phpfui/phpfui directory and supply the path to your public directory / the directory for the various JS and CSS files PHPFUI uses. This will copy all required public files into your public directory. For example:

php vendor/phpfui/phpfui/update.php public/PHPFUI

The PHPFUI library defaults to your-public-directory/PHPFUI, it can be overridden, but it is suggested to use PHPFUI to keep everything in one place. update.php should be run when ever you update PHPFUI.

Versioning

Versioning will match the Foundation versions for Major semantic versions. PHPUI will always support the most recent version of Foundation possible for the Major version. PHPFUI Minor version will include breaking changes and may incorporate changes for the latest version of Foundation. The PHPFUI Patch version will include non breaking changes or additions. So PHPFUI Version 6.0.0 would be the first version of the library, 6.0.1 would be the first patch of PHPFUI. Both should work with any Foundation 6.x version. PHPFUI 6.1.0 will track PHP 7.4 - 8.1, 6.2.0 will track 8.0 - 8.2, but both will still track Foundation 6.x. PHPFUI 7.0.0 would track Foundation 7.x series on currently supported versions of PHP.

Depreciation and Foundation changes

Since major versions of Foundation have in the past depreciated and obsoleted things, PHPFUI will track the latest version of Foundation for class names and functionality. However, when Foundation makes a breaking change or removes something, PHPFUI will continue to support the old functionality as best as possible in the new Foundation framework. Depreciated classes will be put in the \PHPFUI\Vx namespace (where x would be the prior Major Foundation version containing that feature). So if something gets depreciated in a newer version of Foundation, you simply will need to change your code from \PHPFUI\Example to \PHPFUI\V6\Example. The depreciated namespace will only be supported for one Major version of PHPFUI, so it is recommended you migrate off of it in a timely manor.

Full Class Documentation

PHPFUI/InstaDoc

Live Examples

Via PHPFUI/Examples

Unit Testing

Full unit testing using phpfui/html-unit-tester

License

PHPFUI is distributed under the MIT License.

PHP Versions

This library only supports modern versions of PHP which still receive security updates. While we would love to support PHP from the late Ming Dynasty, the advantages of modern PHP versions far out weigh quaint notions of backward compatibility. Time to upgrade.

icalendar's People

Contributors

cogliano avatar phpfui avatar tanabi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

icalendar's Issues

Carriage Returns missing in ICS Files

After following the "simpleevent.php" example, I noticed that the generated ICS files fail common online validators such as https://icalendar.org/validator.html due to missing carriage returns "CRLF".

I've tested the examples/simpleevent.php without further modification, saved the output of $icalobj->export() using PHP 8.2's fputs function and uploaded the generated file to the validator mentioned above.

The error thrown is:

Lines not delimited by CRLF sequence [near line # 1]
Reference: RFC 5545 3.1. Content Lines

I know that carriage returns are a Windows specific thing, but just using linefeeds triggers validators.
It could be worth patching this.

System Environment:

Ubuntu 22.04 ARM64v8 (M1 Pro) in a VM
PHP 8.2 using Ondrej's PHP PPA

Mistake in splitting of long content lines

Hello,

there seems to be a small issue in ZCiCalDataNode.php:138 that prevents events with long content lines from importing into Apple Calendar.

Instead of
$part = $part . \substr($value, 0, 67) . " \r\n";
it should read
$part = $part . \substr($value, 0, 67) . "\r\n ";

See https://icalendar.org/iCalendar-RFC-5545/3-1-content-lines.html
"That is, a long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white-space character (i.e., SPACE or HTAB)."

Error on line #29 of ZCiCalNode.php

Hi. Thanks for forking this!
Just trying to get it working, but I'm getting an error on line #29 of ZCiCalNode.php.

PHP Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST) in **/events/ICalendarOrg/ZCiCalNode.php on line 29

Looking in this file, its setting the following:
public array $child = [];

Should I be parsing anything else into this?

Thanks

VJOURNAL

Hi, I'm developing a (Jooomla) component to handle Journals using iCalendar VJOURNAL items to store and sync entries between sites and devices. Currently I am using the SimpleCalDav php library which hasn't been updated for 8 years (but still pretty much works) but I like the Zcontent/calendar approach and stumbled upon this current fork from there.

A quick look at the code it seems icalendar assumes that only VEVENT items are of interest (in the ZCiCal class)

Any clues as to what might be required or problems there might be to add VJOURNAL (and possibly VTODO) functionality to icalendar.

If it's something you don't want to take on yourself I might be prepared to find time myself with a little guidance. If it's something you can easily do then please consider this a feature request.

VJOURNAL is an under-used feature of the iCal spec that is starting to gain some traction - especially with the release of jtxBoard for Android which provides an excellent. potentially cross-platform, way of sharing journal entries and notes across sites and devices. (basically Journal items are much like events but without an end or duration, and notes don't even have DTSTART)

Validator

Hello,

Via your post in the upstream repo I came across yours. I like the (web-based) validator of the original creator as it helped me with build a way to dynamically generate an ICS file for a Jekyll site (AntennaPod/antennapod.github.io#192).

As new events get added to the site, I would love to have a way to have the validity/correctness of the ICS file checked automatically. Ideally through a GitHub action that we could run as test for each PR.

Would something like that be possible with this library? If so, I guess this is a 'feature request' (even though I realise this is in no way a feature of the PHP library). (I would fully understand if you close as won't fix.)

Error in the docs

Thanks again for sorting this useful library out and making it live again.

Some errors in the docs that caused me a headache and some code searching.

All instances of:
\ICalendarOrg\ZCiCal::fromSqlDateTime();
should be:
\ICalendarOrg\ZDateHelper::fromSqlDateTime();
Cheers,
Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.