本文整理汇总了PHP中Criteria::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::insert方法的具体用法?PHP Criteria::insert怎么用?PHP Criteria::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criteria
的用法示例。
在下文中一共展示了Criteria::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
public function addAction()
{
$post = new Criteria("post");
$is_public = 0;
if (isset($_POST["is_public"])) {
$is_public = 1;
}
$post->insert(array("title" => "\"{$_POST['title']}\"", "content" => "\"{$_POST['content']}\"", "is_public" => $is_public, "created_at" => "NOW()"));
Core::redir("./?r=blog/index");
}
示例2: addAction
public function addAction()
{
$criteria = new Criteria("person");
$criteria->insert(array("no" => "\"{$_POST['no']}\"", "name" => "\"{$_POST['name']}\"", "lastname" => "\"{$_POST['lastname']}\"", "job" => "\"{$_POST['job']}\"", "phone1" => "\"{$_POST['phone1']}\"", "phone2" => "\"{$_POST['phone2']}\"", "address1" => "\"{$_POST['address1']}\"", "address2" => "\"{$_POST['address2']}\"", "email1" => "\"{$_POST['email1']}\"", "email2" => "\"{$_POST['email2']}\"", "team_id" => "\"{$_POST['team_id']}\"", "category_id" => "\"{$_POST['category_id']}\"", "created_at" => "NOW()"));
Core::redir("./?r=team/open&id={$_POST['sucursal_id']}");
}
示例3: Criteria
<?php
if (!empty($_POST)) {
include "admin/app/autoload.php";
include "admin/app/models/TeamData.php";
include "admin/app/models/PersonData.php";
$criteria = new Criteria("item");
$criteria->insert(array("fullname" => "\"{$_POST['fullname']}\"", "phone" => "\"{$_POST['phone']}\"", "address" => "\"{$_POST['address']}\"", "kind" => "\"{$_POST['kind']}\"", "team_id" => "\"{$_POST['team_id']}\"", "msg" => "\"{$_POST['msg']}\"", "created_at" => "NOW()"));
print "<script>alert(\"Mensaje enviado exitosamente.\");</script>";
Core::redir("./");
}
示例4: addcatAction
public function addcatAction()
{
$criteria = new Criteria("category");
$criteria->insert(array("name" => "\"{$_POST['name']}\""));
Core::redir("./?r=index/categories");
}