本文整理汇总了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;