當前位置: 首頁>>代碼示例>>PHP>>正文


PHP content::attach方法代碼示例

本文整理匯總了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');
}
開發者ID:blumine,項目名稱:vunsy,代碼行數:31,代碼來源:addaction.php

示例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');
}
開發者ID:sigit,項目名稱:vunsy,代碼行數:31,代碼來源:addaction.php


注:本文中的content::attach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。