Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kaip padaryti kategorijai OPTGROUP nelieciant kategorija

Parašė fokosasxp· 2011 Bir. 7 23:06:24
#1

Pas manes taip yra





as noriu pasidaryti taip kategorijai OPTGROUP nelieciant kategorija tik gali lieti subkategorijas





ka reikia pakeisti cia visiskai nesuprantu padekite man.


<?if(!empty($this->view->defaultFormArray)){?>
<form name="publishForm" id="publishForm" method="POST" enctype="multipart/form-data">
 
	<div style="margin-bottom:5px;"><b><?=Yii::t('publish_page', 'Category')?></b> (<span style="color:red;">*</span>)</div>
	<div style="margin-bottom:5px;">
		<select id="category_id" name="category_id" class="publish_select">
		<?
		foreach ($this->view->categoryList as $k => $v){?>
			<?if($this->view->defaultFormArray['category_id'] == $k){?>	
				<option value="<?=$k?>" selected="selected"><?=$v?></option>
			<?} else {?>
				<option value="<?=$k?>"><?=$v?></option>
			<?}//end of if?>
		<?}//end of foreach?>
		</select>
	</div>
	<?if(isset($this->view->errorArray['category_id'])){?>
	<div class="publish_error"><?=$this->view->errorArray['category_id']?></div>
	<?}?>

Redagavo fokosasxp· 2011 Bir. 8 00:06:33

Parašė fokosasxp· 2011 Bir. 8 16:06:04
#2

mysql lentele

--------------------------------------------------------
 
--
-- Table structure for table `category`
--
 
CREATE TABLE IF NOT EXISTS `category` (
`category_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`category_parent_id` int(10) unsigned DEFAULT NULL,
`category_title` varchar(255) DEFAULT NULL,
`category_active` tinyint(4) DEFAULT '1',
`category_ord` int(11) DEFAULT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 
--
-- Dumping data for table `category`
--