本文整理汇总了PHP中runner::get_rewrite_url方法的典型用法代码示例。如果您正苦于以下问题:PHP runner::get_rewrite_url方法的具体用法?PHP runner::get_rewrite_url怎么用?PHP runner::get_rewrite_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类runner
的用法示例。
在下文中一共展示了runner::get_rewrite_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$response["success"] = true;
if ($result_apply = \db::query($SQL_apply, $params_apply)) {
$response["apply"] = $result_apply[0];
}
if (isset($field_context["is_label"]) && $field_context["is_label"]) {
$SQL_rewrite = 'SELECT `rewrite_id` FROM `{PREFIX}rewrites` ';
$SQL_rewrite .= 'WHERE `reference` = :reference';
$params_rewrite = array(":reference" => $model->reference);
if (!\db::query($SQL_rewrite, $params_rewrite)) {
$SQL_rewrite = <<<SQL
INSERT INTO `{PREFIX}rewrites` (`url`, `resource_uri`, `reference`, `primary`)
VALUES (:url, :resource_uri, :reference, :primary)
SQL;
$resource_uri = $model->class . '/' . $model->table_id;
$ascii = \runner::get_rewrite_url($value, $model->reference, $resource_uri);
$params_rewrite = array(':url' => $ascii, ':resource_uri' => $resource_uri, ':reference' => $model->reference, ':primary' => 1);
\db::insert($SQL_rewrite, $params_rewrite);
}
// save title
$SQL_meta = 'SELECT model_meta_id, title FROM `{PREFIX}model_metas` ';
$SQL_meta .= 'WHERE `reference` = :reference';
$params_meta = array(":reference" => $model->reference);
$result_meta = \db::query($SQL_meta, $params_meta);
$title = '';
$prefixes = \bootstrap::get("pageproperties_prefix");
if ($prefixes && isset($prefixes["title"])) {
$title .= $prefixes["title"];
}
$title .= $value;
if (!$result_meta) {
示例2: implode
$SQL_UPDATE = 'DELETE FROM `{PREFIX}rewrites` WHERE ';
$SQL_UPDATE .= implode(" AND ", $condition);
\db::query($SQL_UPDATE, $params);
if ($urls = explode(PHP_EOL, $value)) {
$SQL_UPDATE = 'INSERT INTO `{PREFIX}rewrites` (`url`';
foreach (array_keys($condition) as $insert_field) {
$SQL_UPDATE .= ', `' . $insert_field . '`';
}
$SQL_UPDATE .= ') VALUES (:url';
foreach (array_keys($params) as $param_field) {
$SQL_UPDATE .= ', ' . $param_field;
}
$SQL_UPDATE .= ')';
foreach ($urls as $url) {
if ($url) {
$params[":url"] = \runner::get_rewrite_url($url, $resource["reference"], $resource["resource_uri"]);
\db::query($SQL_UPDATE, $params);
}
}
}
$response["success"] = true;
}
}
if ($response["success"] && ($result_apply = \db::query($SQL_apply, $params_apply))) {
$response["apply"] = $result_apply[0];
}
break;
case "title":
case "keywords":
case "description":
// model_metas table direct column