0
다음과 같은 솔루션을 만들려고하지만 간단한 MySQL 쿼리를 사용합니다 (아래에 사용 된 정적 버전 대신 단어/태그가 코드에 구현 됨). MySQL 테이블의 이름은 "tags"이고 "id"& "tag"라는 두 개의 열이 있습니다.젠드 프레임 워크로 태그 달기
불행히도 저는 초보자이며 이것을 해결할 수 없었습니다. 누군가 나를 도울 수 있습니까?
/* Zend_Tag_Item version*/
$list = new Zend_Tag_ItemList();
$list[] = new Zend_Tag_Item(array('title' => 'Code', 'weight' => 50));
$list[] = new Zend_Tag_Item(array('title' => 'Zend Framework', 'weight' => 1));
$list[] = new Zend_Tag_Item(array('title' => 'PHP', 'weight' => 5));
$list->spreadWeightValues(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
foreach ($list as $item) {
$this->view->tagtitle = $item->getTitle();
$this->view->tagweight = $item->getParam('weightValue');
}
/* Zend_Tag_Cloud version*/
$cloud = new Zend_Tag_Cloud(array(
'tags' => array(
array('title' => 'Code', 'weight' => 50,
'params' => array('url' => '/tag/code')),
array('title' => 'Zend Framework', 'weight' => 1,
'params' => array('url' => '/tag/zend-framework')),
array('title' => 'PHP', 'weight' => 5,
'params' => array('url' => '/tag/php')),
)
));
$formdata->pagecontent->tagging = $cloud;
id는을하지 않을 수도 있습니다 올바른 방법으로 체중을 구현하는 :) 더 나은 태그와 카운트 (태그)에 의해 그룹으로 쿼리를 할 것입니다 –
나는 upvote 것이지만 '체중'물건을 편집해야합니다! – RageZ
나는 그것이 사용자에게 달렸다고 생각한다, 그녀는 그녀가 단지 id & tag를 가지고 있다고 말한다 :) – Chris