$a = true;
$b = true;
if (($a == false) || ($b == false)) {
echo "BAD";
} else {
echo "OK";
}
Run Code Online (Sandbox Code Playgroud)
为什么这会让我觉得"不好"?我该怎么办呢?
M schema.yml:
News:
columns:
title:
type: string(50)
category_id:
type: integer(4)
relations:
Category:
local: category_id
foreign: category_id
type: one
Category:
columns:
category_name:
type: string(50)
generator:
class: sfDoctrineGenerator
param:
model_class: News
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: news
with_doctrine_route: true
actions_base_class: sfActions
config:
actions: ~
fields: ~
list:
display: [news_id, title, category_name]
filter:
display: [news_id, title, category_id]
form: ~
edit: ~
new: ~
Run Code Online (Sandbox Code Playgroud)
在news.class中:
public function getCategoryName()
{
return $this->getCategories()->getCategoryName();
}
Run Code Online (Sandbox Code Playgroud)
这有效,但我不能对这个字段进行排序.我可以按id,title,category_id排序,但不能按category_name排序.如何按此自定义列排序?
<select id="select">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<span id="red">red </span> <span id="default">default</span>
$("#red").click(function(){
$("#select").css('background-color', 'red');
});
$("#default").click(function(){
$("#select").css('background-color', 'white');
});
Run Code Online (Sandbox Code Playgroud)
如果我点击红色然后选择是红色.如何设置选择的默认样式,对白色?
php ×2
css ×1
doctrine ×1
html ×1
if-statement ×1
javascript ×1
jquery ×1
symfony-1.4 ×1
symfony1 ×1