• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Community Auth - Call to undefined method

#1
Hello!
Please help me!
When I add the code to the controller:
Code:
if( $this->require_role('admin') )
{
   
}
Indicates an error:
Code:
Fatal error: Call to undefined method Welcome::require_role() in /home/q/q9273345/q9273345.beget.tech/public_html/app_crm/controllers/Welcome.php on line 35
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/q/q9273345/q9273345.beget.tech/public_html/app_crm/controllers/Welcome.php:35)

Filename: core/Common.php

Line Number: 573

Backtrace:

A PHP Error was encountered

Severity: Error

Message: Call to undefined method Welcome::require_role()

Filename: controllers/Welcome.php

Line Number: 35

Backtrace:

But under the link http://q9273345.beget.tech/examples/index everything works. Errors do not show.
Reply

#2
Your Welcome.php controller needs to extend MY_Controller.
Reply

#3
(05-06-2017, 03:18 PM)skunkbad Wrote: Ваш контроллер Welcome.php должен расширить MY_Controller.

Thank you very much!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.