Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Potrzebuję pomocy ze wstawieniem zmiennej.
Gemmern
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 1.05.2014

Ostrzeżenie: (0%)
-----


Witajcie, jestem bardzo początkujący w tych sprawach.

Mam skrypt php -
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. /**
  4.  * Controller Translations
  5.  */
  6.  
  7.  
  8. class Controller_Panel_Newsletter extends Auth_Controller {
  9.  
  10.  
  11.  
  12. public function action_index()
  13. {
  14.  
  15. // validation active
  16. Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Newsletter')));
  17. $this->template->title = __('Newsletter');
  18. //$this->template->styles = array('http://cdn.jsdelivr.net/sceditor/1.4.3/themes/default.min.css' => 'screen');
  19. $this->template->scripts['footer'][] = 'js/jquery.sceditor.min.js';
  20.  
  21. $user = new Model_User();
  22. $user->where('status','=',Model_User::STATUS_ACTIVE);
  23. $user = $user->count_all();
  24.  
  25. if($this->request->post())
  26. {
  27. $query = DB::select('email')->select('name')
  28. ->from('users')
  29. ->where('status','=',Model_User::STATUS_ACTIVE)
  30. ->execute();
  31.  
  32. $users = $query->as_array();
  33. if (count($users)>0 OR Core::post('subject')!=NULL)
  34. {
  35. if ( !Email::send($users,'',Core::post('subject'),Core::post('description'),Core::post('from'), Core::post('from_email') ) )
  36. Alert::set(Alert::ERROR,__('Error on mail delivery, not sent'));
  37. else
  38. Alert::set(Alert::SUCCESS,__('Email sent to all the users'));
  39. }
  40. else
  41. {
  42. Alert::set(Alert::ERROR,__('Mail not sent'));
  43. }
  44.  
  45.  
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52. $this->template->content = View::factory('oc-panel/pages/newsletter',array('count'=>$user));
  53.  
  54. }
  55.  
  56.  
  57.  
  58.  
  59. }//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.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.12.2025 - 23:46