Php Atk框架问题
在employee节点中,我这样写Php Atk框架问题,php,Php,在employee节点中,我这样写 <?php class employee extends atkNode{ function employee(){ //$this->atkNode("employee"); $this->atkNode("employee" ,NF_ADD_LINK); $this->setTable("newmod1_employee"); $this->add(new atkNumberAt
<?php
class employee extends atkNode{
function employee(){
//$this->atkNode("employee");
$this->atkNode("employee" ,NF_ADD_LINK);
$this->setTable("newmod1_employee");
$this->add(new atkNumberAttribute("id",AF_AUTOKEY));
$this->add(new atkAttribute("name" ,AF_OBLIGATORY|AF_SEARCHABLE),NULL,10);
$this->add(new atkListAttribute("designation",array('Manager','Junior Scientist ','PHP Programmer','Sap Programmer','Quality Analyist'),AF_OBLIGATORY),NULL,40);
$this->add(new atkDateAttribute("date",AF_OBLIGATORY),NULL,45);
$this->add(new atkAttribute("location",AF_OBLIGATORY),NULL,50);
$this->add(new atkattribute("branch",AF_OBLIGATORY),NULL,55);
//$this->add(new atkManyToOneRelation("designation","newmod1.employee",AF_SEARCHABLE));
$this->add(new atkNumberAttribute("employeecode",AF_OBLIGATORY),NULL,60);
$this->add(new atkEmailAttribute("email",AF_OBLIGATORY),NULL,65);
}
/*
public function adminFooter(){
return nodeSourceUrl("newmod1.employee");
}*/
}
class department extends atkNode {
//$descriptor_field="[designation]-[destination]";
function department() {
$this->atkNode("department" ,NF_ADD_LINK);
$this->setTable("newmod1_department");
$this->add(new atkNumberAttribute("id",AF_AUTOKEY), NULL,10);
$this->add(new atkAttribute("name" ,AF_READ_ONLY,AF_OBLIGATORY|AF_SEARCHABLE),NULL,20 );
$this->add(new atkAttribute("branch",AF_OBLIGATORY), NULL,30);
$this->add(new atkListAttribute("designation",array('Manager','Junior Scientist','PHP Programmer','Sap Programmer','Quality Analyist'),AF_PRIMARY|AF_SEARCHABLE|AF_FORCE_LOAD|AF_OBLIGATORY),NULL,40);
//$this->addFilter(new atkOneToManyRelation("designation","newmod1.designation","id", AF_OBLIGATORY), "employees");
$this->add(new atkattribute("Salary",AF_TOTAL ) );
}
/*
public function adminFooter(){
return nodeSourceUrl("newmod1.employee");
}*/
}
我已经为这两个节点创建了一个表。我不知道如何使用部门节点的过滤器和验证器 您需要在employee表和department表之间设置ATKONETOMANY关系 建议您在ATK论坛上发布此查询,网址为 韦恩