本文整理汇总了PHP中content::attach方法的典型用法代码示例。如果您正苦于以下问题:PHP content::attach方法的具体用法?PHP content::attach怎么用?PHP content::attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::attach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
}
$c->parent_section = $ci->input->post("parent_section");
$c->parent_content = $ci->input->post("parent_content");
$c->cell = $ci->input->post("cell");
$c->sort = $ci->input->post("sort");
$c->path = $ci->input->post("path");
$c->type = $ci->input->post("type");
$c->subsection = $ci->input->post("subsection") == NULL ? FALSE : TRUE;
$c->view = $ci->input->post("view");
$c->addin = $ci->input->post("addin");
$old_edit = $c->can_edit();
$c->edit = $ci->input->post("edit");
$c->del = $ci->input->post("del");
$c->info = $ci->input->post("info");
if (!$ci->input->post("id")) {
$p = new content();
$p->get_by_id($c->parent_content);
$c->attach($ci->vunsy->section, $p, $c->cell, $c->sort);
}
$p = new Section();
$p->get_by_id($c->parent_section);
if ($p->can_addin() and !$ci->input->post("id") or $ci->input->post("id") and $old_edit) {
$c->save();
if ($ci->input->post("id")) {
redirect($ci->app->app_url("data/{$c->id}"));
} else {
$ci->app->add_info('Content added');
}
} else {
$ci->app->add_error('Permission denied ! please check your root adminstrator for permissions');
}
示例2: Section
if ($ci->input->post("id") !== FALSE) {
$c->get_by_id($ci->input->post("id"));
$old_edit = $c->can_edit();
}
$c->parent_section = $ci->input->post("parent_section");
$c->parent_content = $ci->input->post("parent_content");
$c->cell = $ci->input->post("cell");
$c->sort = $ci->input->post("sort");
$c->path = $ci->input->post("path");
$c->type = $ci->input->post("type");
$c->subsection = $ci->input->post("subsection") == FALSE ? FALSE : TRUE;
$c->view = $ci->input->post("view");
$c->addin = $ci->input->post("addin");
$c->edit = $ci->input->post("edit");
$c->del = $ci->input->post("del");
$c->info = $ci->input->post("info");
$sec = new Section();
$sec->get_by_id($c->parent_section);
$p = new Content();
$p->get_by_id($c->parent_content);
if ($p->can_addin() and $ci->input->post("id") === FALSE or $ci->input->post("id") !== FALSE and $old_edit) {
if ($ci->input->post("id") === FALSE) {
$c->attach($sec, $p, $c->cell, $c->sort);
$ci->app->add_info('Content added');
} else {
$c->save();
redirect($ci->app->app_url("data/{$c->id}"));
}
} else {
$ci->app->add_error('Permission denied ! please check your root adminstrator for permissions');
}