Mam skrypt php -
/** * Controller Translations */ class Controller_Panel_Newsletter extends Auth_Controller { public function action_index() { // validation active Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Newsletter'))); $this->template->title = __('Newsletter'); //$this->template->styles = array('http://cdn.jsdelivr.net/sceditor/1.4.3/themes/default.min.css' => 'screen'); $this->template->scripts['footer'][] = 'js/jquery.sceditor.min.js'; $user = new Model_User(); $user->where('status','=',Model_User::STATUS_ACTIVE); $user = $user->count_all(); if($this->request->post()) { $query = DB::select('email')->select('name') ->from('users') ->where('status','=',Model_User::STATUS_ACTIVE) ->execute(); $users = $query->as_array(); { if ( !Email::send($users,'',Core::post('subject'),Core::post('description'),Core::post('from'), Core::post('from_email') ) ) Alert::set(Alert::ERROR,__('Error on mail delivery, not sent')); else Alert::set(Alert::SUCCESS,__('Email sent to all the users')); } else { Alert::set(Alert::ERROR,__('Mail not sent')); } } } }//end of controller
I z tego oto kodu chciałbym wstawić do odmiennej podstrony zmienną <?=$count?>, tyle tylko, że po prostu mi nie działa. Dostaję błąd Undefined variable: count i nie wiem jak sobie z tym poradzić.
Pozdrawiam,
Gemmern.