2017-04-19 38 views
0

我想使用Redux複選框並選擇選項,如同在前端一樣。 在Redux documents我沒有發現任何關於如果&其他。如何使用if和else作爲複選框或select in redux

我想是這樣的:

<?php if ($redux_demo['opt_checkbox']) { echo "my text" } else { echo"the other text" } endif ?> 
+0

我不熟悉的框架,而是一個複選框,一般都會講設置(如果它被選中)或未設置(如果沒有選中)。你可以使用'isset()'來檢查。 – Qirel

回答

0
<?php 
$checkboxset = "ABC"; 
if ($redux_demo['opt_checkbox']==$checkboxset) { echo "my text" } else { echo"the other text" } ?> 
0

試試這個

if (!(isset($redux_demo['opt_checkbox']))) 
{ 
    echo "my text"; 
} 
else 
{ 
    echo"the other text" 
}