nuovo / vCard-parser

Easier and more concise vCard (.vcf) parser for PHP
http://nuovo.lv/
MIT License
126 stars 56 forks source link

Howto create new entry with type and sub element (eg: adr) #3

Closed xbgmsharp closed 12 years ago

xbgmsharp commented 12 years ago

Hi,

I am able to create simple entry with type HOME for example: $vCard -> tel('555-1111', 'Home'); $vCard -> tel('555-1234', 'Work');

But how to do the same for ADR. with type and subvalue like StreetAddress I am unable to figure it out. Shold not be like this: $vCard -> adr('My Country', 'Work', 'StreetAddress'); $vCard -> adr('My Country', 'StreetAddress', 'Work' );

I try to pass it as an array but no luck $vCard -> adr('My Country', array('StreetAddress', 'Work') );

Any ideas?

xbgmsharp commented 12 years ago

The same apply to add photo.

xbgmsharp commented 12 years ago

Any update?

xbgmsharp commented 12 years ago

Any update?

pilsetnieks commented 12 years ago

Check out write-test.php - there's an example now of how to add an address. It works but it seems that I have to rethink the way complex values are added because this may be somewhat cumbersome.

phobos2077 commented 11 years ago

This doesn't actually answer the question. In write-test.php I can see only adding different parts of structured field (StreetAddress, Locality, etc.) but not the Type. Looks like structured fields need to be rewritten.