<?php
class ControllerModuleNews extends Controller {
protected function index() {
$this->language->load('module/news');
$this->load->model('extension/news');
'page' => 1,
'limit' => 6,
'start' => 0,
);
$this->data['heading_title'] = $this->language->get('heading_title');
$all_news = $this->model_extension_news->getAllNews($data);
$this->data['all_news'] = array();
foreach ($all_news as $news) {
$this->data['all_news'][] = array ( 'view' => $this->url->link('information/news/news', 'news_id=' . $news['news_id']),
);
}
if (file_exists(DIR_TEMPLATE
. $this->config->get('config_template') . '/template/module/news.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/news.tpl';
} else {
$this->template = 'default/template/module/news.tpl';
}
$this->render();
}
}
function dateV($format,$timestamp=null){
'l'=>array('dat'=>'N','str'=>array('Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota','Niedziela')),
'M'=>array('dat'=>'n','str'=>array('styczeń','luty','marzec','kwiecień','maj','czerwiec','lipiec','sierpień','wrzesień','październik','listopad','grudzień')),
'M'=>array('dat'=>'n','str'=>array('stycznia','lutego','marca','kwietnia','maja','czerwca','lipca','sierpnia','września','października','listopada','grudnia'))
);
if ($pieces = preg_split('#[:/.\-, ]#', $format)){ if ($timestamp === null) { $timestamp = time(); } foreach ($pieces as $datepart){
$replace[] = $to_convert[$datepart]['str'][(date($to_convert[$datepart]['dat'],$timestamp)-1
)]; }else{
$replace[] = date($datepart,$timestamp); }
}
$result = strtr($format,array_combine
($pieces,$replace)); return $result;
}
}
// Środa 2 września 2009
?>
Jak powiązać powyższy kod aby powyświetleniu:
<?php echo $news['date_added']; ?>
otrzymać wynik zwrócony z bazy danych w postaci: "10 kwietnia 2013 " zamiast "10 Apr 2013"
Z góry wielkie dzięki za jakąkolwiek pomoc. Będe bardzo wdzięczny za nakierowanie mnie albo wskazanie jakiegoś manuala do mojego problemu