本文整理汇总了PHP中Ad::find_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Ad::find_all方法的具体用法?PHP Ad::find_all怎么用?PHP Ad::find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ad
的用法示例。
在下文中一共展示了Ad::find_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
header("Content-Type: text/html; charset=utf-8");
require_once './includes/initialize.php';
function __autoload($class_name)
{
if ($class_name != 'DbSimple_Mysqli' && $class_name != 'Smarty') {
require_once CLASS_PATH . '/class.' . $class_name . '.php';
}
}
$smarty->assign('lesson_number', 10);
$smarty->assign('organization_form', array('0' => 'Частное лицо', '1' => 'Организация'));
$smarty->assign('cities', City::get_column_values('name'));
$smarty->assign('labels', Category::find_all_categories());
$smarty->assign('subcategories', Category::get_array_of_subcategories());
$object_storage = Ad::find_all();
$edit_id = '';
if (request_is_post()) {
$tmp_post = $_POST;
//escape POST array; can be more complex
foreach ($tmp_post as $key => $value) {
$tmp_post[$key] = strip_tags($value);
}
//checking checkbox. if it's not checked then there is no value in POST array
if (!isset($tmp_post['allow_mails'])) {
$tmp_post['allow_mails'] = "";
}
$ad = Ad::build($tmp_post);
//create new object
$ad->save();
//save object in database
示例2: fillStorage
/**
* Get all records of ad from database
*
* @global type $database
* @return type
*/
public function fillStorage()
{
global $database;
$this->ads = Ad::find_all();
return self::$instance;
}