当前位置: 首页>>代码示例>>PHP>>正文


PHP content::get_by_id方法代码示例

本文整理汇总了PHP中content::get_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP content::get_by_id方法的具体用法?PHP content::get_by_id怎么用?PHP content::get_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在content的用法示例。


在下文中一共展示了content::get_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addaction

 public function addaction()
 {
     $c = new content();
     if ($this->input->post("id") !== FALSE) {
         $c->get_by_id($this->input->post("id"));
     } else {
         if ($this->input->post("id") === FALSE) {
             $c->user = $this->ion_auth->get_user();
             $c->user = $c->user->id;
         }
     }
     $c->parent_section = $this->input->post("parent_section");
     $c->parent_content = $this->input->post("parent_content");
     $c->title = $this->input->post("title");
     $c->cell = $this->input->post("cell");
     $c->sort = $this->input->post("sort");
     $c->path = $this->input->post("path");
     $c->type = $this->input->post("type");
     $c->subsection = $this->input->post("subsection") == FALSE ? FALSE : TRUE;
     $c->view = $this->input->post("view");
     $c->info = $this->input->post("info");
     $c->filter = $this->input->post("filter");
     // this is a workaround, cuz it makes 2 newline characters
     // and i don't know what the hell is wrong with it.
     $c->filter = str_replace("\n\n", "\n", $c->filter);
     $p = new Content($c->parent_content);
     if ($this->input->post("id") === FALSE) {
         $this->add_info(lang('system_content_added'));
     } else {
         $this->ajax = TRUE;
         $this->print_text(lang('system_content_edited'));
     }
     $c->save();
 }
开发者ID:kabircse,项目名称:Codeigniter-Egypt,代码行数:34,代码来源:editor.php

示例2: content

<?php

$ci =& get_instance();
$ci->load->library('gui');
$c = new content();
if ($ci->input->post("id")) {
    $c->get_by_id($ci->input->post("id"));
}
$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")) {
开发者ID:blumine,项目名称:vunsy,代码行数:31,代码来源:addaction.php


注:本文中的content::get_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。