本文整理汇总了PHP中Ad::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Ad::getTitle方法的具体用法?PHP Ad::getTitle怎么用?PHP Ad::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ad
的用法示例。
在下文中一共展示了Ad::getTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handlePostQuery
public static function handlePostQuery(array $sanitized_post_array)
{
// The result of the request
$ajax_result = array('status' => '', 'message' => '', 'data' => '');
$is_edit_mode = isset($sanitized_post_array['id']);
$ad = new Ad($sanitized_post_array);
$result = $ad->save();
$sanitized_title = htmlentities($ad->getTitle());
if ($result) {
$ajax_result['status'] = 'success';
$ajax_result['message'] = 'Ad "' . $sanitized_title . '" has been ' . ($is_edit_mode ? '" updated' : '"added') . ' successfully .';
$ajax_result['data'] = ['id' => $ad->getId()];
} else {
$ajax_result['status'] = 'error';
$ajax_result['message'] = 'Error while ad "' . $sanitized_title . ($is_edit_mode ? '" updating ' : '" adding') . '.';
}
return $ajax_result;
}
示例2: handlePostQuery
public static function handlePostQuery(array $sanitized_post_array, $view)
{
/* @var $view Smarty */
// The result of the request
$ajax_result = array('status' => '', 'message' => '', 'data' => '');
$is_edit_mode = isset($sanitized_post_array['id']);
$ad = new Ad($sanitized_post_array);
$result = $ad->save();
$sanitized_title = htmlentities($ad->getTitle());
if ($result) {
$ajax_result['status'] = 'success';
$ajax_result['message'] = 'Ad "' . $sanitized_title . '" has been ' . ($is_edit_mode ? '" updated' : '"added') . ' successfully .';
$view->assign('ad_in_table', $ad);
$class_name = $ad->getOrganizationFormId() == '1' ? 'organization' : 'individual';
$ajax_result['data'] = $view->fetch('table_row_' . $class_name . '.tpl.html');
} else {
$ajax_result['status'] = 'error';
$ajax_result['message'] = 'Error while ad "' . $sanitized_title . ($is_edit_mode ? '" updating ' : '" adding') . '.';
}
return $ajax_result;
}