PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Tags

When retrieved, tags are sorted in decreasing order (i.e. highest first) by the number of links that use the tag.

Example 819. Working With Tags

<?php
$simpy 
= new Zend_Service_Simpy('yourusername''yourpassword');

/* Save a link with tags */
$simpy->saveLink(
    
'Zend Framework' // Title
    
'http://framework.zend.com'// URL
    
Zend_Service_Simpy_Link::ACCESSTYPE_PUBLIC// Access Type
    
'zend, framework, php' // Tags
);

/* Get a list of all tags in use by links and notes */
$tagSet $simpy->getTags();

/* Display each tag with the number of links using it */
foreach ($tagSet as $tag) {
    echo 
$tag->getTag();
    echo 
' - ';
    echo 
$tag->getCount();
    echo 
'<br />';
}

/* Remove the 'zend' tag from all links using it */
$simpy->removeTag('zend');

/* Rename the 'framework' tag to 'frameworks' */
$simpy->renameTag('framework''frameworks');

/* Split the 'frameworks' tag into 'framework' and
'development', which will remove the 'frameworks' tag for
all links that use it and add the tags 'framework' and
'development' to all of those links */
$simpy->splitTag('frameworks''framework''development');

/* Merge the 'framework' and 'development' tags back into
'frameworks', basically doing the opposite of splitting them */
$simpy->mergeTags('framework''development''frameworks');

Zend Framework