Phpcms the code below to invoke the Add () method under the content module in the specified location to submit the data, how to implement?

Source: Internet
Author: User


, submitted by other pages $_post[' info ' article data to the current page, after the authorization and column validation or judgment, using the content controller's Add method to submit to the database? How should I write?

Reply content:


, submitted by other pages $_post[' info ' article data to the current page, after the authorization and column validation or judgment, using the content controller's Add method to submit to the database? How should I write?

//$siteid=1;    //$categorys = getcache('category_content_'.$siteid,'commons'); //缓存文件    pc_base::load_model('content_model'); //加载内容模型    $add_content = new content_model(); //    $modelid = $categorys[$catid]['modelid']; //获得模型id    $add_content->set_model($modelid);    //初始化   $add_content->add_content($info); //$info提交的内容
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.