本文整理汇总了PHP中BigTree::trimLength方法的典型用法代码示例。如果您正苦于以下问题:PHP BigTree::trimLength方法的具体用法?PHP BigTree::trimLength怎么用?PHP BigTree::trimLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigTree
的用法示例。
在下文中一共展示了BigTree::trimLength方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
?>
<?php
foreach ($list as $option) {
?>
<option value="<?php
echo BigTree::safeEncode($option["value"]);
?>
"<?php
if ($field["value"] == $option["value"]) {
?>
selected="selected"<?php
}
if ($option["access_level"]) {
?>
data-access-level="<?php
echo $option["access_level"];
?>
"<?php
}
?>
><?php
echo BigTree::safeEncode(BigTree::trimLength(strip_tags($option["description"]), 100));
?>
</option>
<?php
}
?>
</select>
<?php
}
示例2: foreach
</li>
<?php
$x++;
}
?>
</ul>
<footer>
<select>
<?php
foreach ($list as $id => $title) {
?>
<option value="<?php
echo BigTree::safeEncode($id);
?>
"><?php
echo BigTree::safeEncode(BigTree::trimLength(strip_tags($title), 100));
?>
</option>
<?php
}
?>
</select>
<a href="#" class="add button"><span class="icon_small icon_small_add"></span>Add Item</a>
<?php
if ($field["options"]["show_add_all"]) {
?>
<a href="#" class="add_all button">Add All</a>
<?php
}
if ($field["options"]["show_reset"]) {
?>
示例3: foreach
<?php
$x++;
}
?>
</ul>
<footer>
<select>
<?php
foreach ($callouts as $callout) {
if (!in_array($callout["id"], $group["callouts"])) {
?>
<option value="<?php
echo BigTree::safeEncode($callout["id"]);
?>
"><?php
echo BigTree::safeEncode(BigTree::trimLength(strip_tags($callout["name"]), 100));
?>
</option>
<?php
}
}
?>
</select>
<a href="#" class="add button"><span class="icon_small icon_small_add"></span>Add Callout</a>
</footer>
</div>
</fieldset>
</section>
<footer>
<input type="submit" class="button blue" value="Update" />
</footer>
示例4:
echo $field["key"];
?>
[<?php
echo $x;
?>
][__internal-subtitle]" value="<?php
echo BigTree::safeEncode($item["__internal-subtitle"]);
?>
" />
<span class="icon_sort"></span>
<p>
<?php
echo BigTree::trimLength(BigTree::safeEncode($item["__internal-title"]), 100);
?>
<small><?php
echo BigTree::trimLength(BigTree::safeEncode($item["__internal-subtitle"]), 100);
?>
</small>
</p>
<a href="#" class="icon_delete"></a>
<a href="#" class="icon_edit"></a>
</li>
<?php
$x++;
}
?>
</ul>
<footer>
<a href="#" class="add_item button"><span class="icon_small icon_small_add"></span>Add Item</a>
<?php
if ($max) {
示例5: foreach
$item[$key] = BigTree::untranslateArray(json_decode($val, true));
} else {
$item[$key] = $cms->replaceInternalPageLinks($val);
}
}
if ($feed["options"]["link_gen"]) {
$link = $feed["options"]["link_gen"];
foreach ($item as $key => $val) {
$link = str_replace("{" . $key . "}", $val, $link);
}
} else {
$link = $item[$feed["options"]["link"]];
}
$content = $item[$feed["options"]["description"]];
$limit = $feed["options"]["content_limit"] ? $feed["options"]["content_limit"] : 500;
$blurb = BigTree::trimLength($content, $limit);
?>
<item>
<guid><?php
echo WWW_ROOT;
?>
feeds/<?php
echo $feed["route"];
?>
/<?php
echo $f["id"];
?>
</guid>
<title><![CDATA[<?php
echo strip_tags($item[$feed["options"]["title"]]);
?>
示例6: foreach
foreach ($entries as $entry) {
?>
<li>
<input type="hidden" name="<?php
echo $field["key"];
?>
[<?php
echo $x;
?>
]" value="<?php
echo htmlspecialchars(json_encode($entry));
?>
" />
<span class="icon_sort"></span>
<p><?php
echo BigTree::safeEncode(BigTree::trimLength(strip_tags(current($entry)), 100));
?>
</p>
<a href="#" class="icon_delete"></a>
<a href="#" class="icon_edit"></a>
</li>
<?php
$x++;
}
?>
</ul>
<footer>
<a href="#" class="add button"><span class="icon_small icon_small_add"></span>Add Item</a>
</footer>
</div>
<script>
示例7: sqlescape
$search_term = $admin->makeIPL($search_term);
}
$w = "'%" . sqlescape($search_term) . "%'";
// Get the "Pages" results.
$r = $admin->searchPages($search_term, array("title", "resources", "meta_keywords", "meta_description", "nav_title"), "50");
$pages = array();
foreach ($r as $f) {
$access_level = $admin->getPageAccessLevel($f["id"]);
if ($access_level) {
$res = json_decode($f["resources"], true);
$bc = $cms->getBreadcrumbByPage($f);
$bc_parts = array();
foreach ($bc as $part) {
$bc_parts[] = '<a href="' . ADMIN_ROOT . 'pages/view-tree/' . $part["id"] . '/">' . $part["title"] . '</a>';
}
$result = array("id" => $f["id"], "title" => $f["nav_title"], "description" => BigTree::trimLength(strip_tags($res["page_content"]), 450), "link" => ADMIN_ROOT . "pages/edit/" . $f["id"] . "/", "breadcrumb" => implode(" › ", $bc_parts));
$pages[] = $result;
$total_results++;
}
}
if (count($pages)) {
$results["Pages"] = $pages;
}
// Get every module's results based on auto module views.
$modules = $admin->getModules("name ASC");
foreach ($modules as $m) {
// Get all auto module view actions for this module.
$actions = $admin->getModuleActions($m);
foreach ($actions as $action) {
if ($action["view"]) {
$view = BigTreeAutoModule::getView($action["view"]);
示例8: isset
<?php
$admin->requireLevel(1);
$query = isset($_GET["query"]) ? $_GET["query"] : "";
$page = isset($_GET["page"]) ? $_GET["page"] : 1;
$pages = $admin->getSettingsPageCount($query);
$results = $admin->getPageOfSettings($page, $query);
foreach ($results as $item) {
if (is_array($item["value"])) {
$value = "— Click Edit To View —";
} else {
$value = BigTree::trimLength(strip_tags($item["value"]), 100);
}
?>
<li>
<section class="settings_name"><?php
echo $item["name"];
?>
</section>
<section class="settings_value"><?php
echo $value;
?>
</section>
<section class="view_action"><a href="<?php
echo ADMIN_ROOT;
?>
settings/edit/<?php
echo $item["id"];
?>
/" class="icon_edit"></a></section>
</li>