本文整理匯總了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");
}