getTabs()->add($action, array( 'title' => ucfirst($action), 'url' => Url::fromPath( 'list/' . str_replace(' ', '', $action) ) ))->activate($action); } /** * Display the application log */ public function applicationlogAction() { if (! Logger::writesToFile()) { throw new ActionError('Site not found', 404); } $this->addTitleTab('application log'); $pattern = '/^(?[0-9]{4}(-[0-9]{2}){2}' // date . 'T[0-9]{2}(:[0-9]{2}){2}([\\+\\-][0-9]{2}:[0-9]{2})?)' // time . ' - (?[A-Za-z]+)' // loglevel . ' - (?.*)$/'; // message $loggerWriter = Logger::getInstance()->getWriter(); $resource = new FileReader(new Config(array( 'filename' => $loggerWriter->getPath(), 'fields' => $pattern ))); $this->view->logData = $resource->select()->order('DESC')->paginate(); } }