本文整理匯總了PHP中Slug::like方法的典型用法代碼示例。如果您正苦於以下問題:PHP Slug::like方法的具體用法?PHP Slug::like怎麽用?PHP Slug::like使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Slug
的用法示例。
在下文中一共展示了Slug::like方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Slug
<?php
$s = new Slug();
$slug_count = $s->like('id', 'category.', 'after')->count();
$c = new Category();
$content_count = $c->count();
if ($slug_count < $content_count) {
$slugs = array();
$c = new Category();
foreach ($c->select('slug')->get_iterated() as $content) {
$slugs[] = "('category." . $content->slug . "')";
}
$slugs = join(', ', $slugs);
$this->db->query("INSERT INTO {$s->table}(id) VALUES {$slugs} ON DUPLICATE KEY UPDATE id=id;");
}
$done = true;
示例2: Slug
<?php
$s = new Slug();
$slug_count = $s->like('id', 'page.', 'after')->count();
$c = new Text();
$content_count = $c->where('page_type', 1)->count();
if ($slug_count < $content_count) {
$slugs = array();
$c = new Text();
foreach ($c->where('page_type', 1)->select('slug')->get_iterated() as $content) {
$slugs[] = "('page." . $content->slug . "')";
}
$slugs = join(', ', $slugs);
$this->db->query("INSERT INTO {$s->table}(id) VALUES {$slugs} ON DUPLICATE KEY UPDATE id=id;");
}
$done = true;
示例3: Slug
<?php
$s = new Slug();
$slug_count = $s->like('id', 'essay.', 'after')->count();
$c = new Text();
$content_count = $c->where('page_type', 0)->count();
if ($slug_count < $content_count) {
$slugs = array();
$c = new Text();
foreach ($c->where('page_type', 0)->select('slug')->get_iterated() as $content) {
$slugs[] = "('essay." . $content->slug . "')";
}
$slugs = join(', ', $slugs);
$this->db->query("INSERT INTO {$s->table}(id) VALUES {$slugs} ON DUPLICATE KEY UPDATE id=id;");
}
$done = true;
示例4: Slug
<?php
$s = new Slug();
$slug_count = $s->like('id', 'content.', 'after')->count();
$c = new Content();
$content_count = $c->count();
if ($slug_count < $content_count) {
$slugs = array();
$c = new Content();
foreach ($c->select('slug')->get_iterated() as $content) {
$slugs[] = "('content." . $content->slug . "')";
}
$slugs = join(', ', $slugs);
$this->db->query("INSERT INTO {$s->table}(id) VALUES {$slugs} ON DUPLICATE KEY UPDATE id=id;");
}
$done = true;
示例5: Slug
<?php
$s = new Slug();
$slug_count = $s->like('id', 'album.', 'after')->count();
$c = new Album();
$content_count = $c->count();
if ($slug_count < $content_count) {
$slugs = array();
$c = new Album();
foreach ($c->select('slug')->get_iterated() as $content) {
$slugs[] = "('album." . $content->slug . "')";
}
$slugs = join(', ', $slugs);
$this->db->query("INSERT INTO {$s->table}(id) VALUES {$slugs} ON DUPLICATE KEY UPDATE id=id;");
}
$done = true;