Call function in indexController from another controller Zend

Walllter

Need to call some function from another controller (not IndexController), for example:

class IndexController extends Zend_Controller_Action
{

public function indexAction()
{
    $someFunction = new CustomController();
    $someFunction->someFunc();
}

} But this throws an error :

Fatal error: Class 'CustomController' not found in C:\xampp\htdocs\demo.ru\application\controllers\IndexController.php on line 13
liyakat

If YourController::memberFunction() does something that is needed across multiple controllers, put that code in a action helper or library class,

so that both controllers can access the shared functionality without having to depend on each other.

I would suggest you to follow DRY and move those functions to common library place.

to use with Namespace see

Zend Framework calling another Controller Action

hope this will sure help you.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to call a controller function from another controller?

From Dev

iPhone - Call function from another view controller

From Dev

How to call a function from another controller in angularjs?

From Dev

Remove Index from indexController in zend framework application

From Dev

How to call a method of another controller in zend?

From Dev

AngularJS: Call controller update function from another controller or JS

From Dev

Call function from one controller to another controller using Factory in Angularjs

From Dev

How to call a function written in one controller from another controller in mvc

From Dev

Call a controller function of one module from controller of another module in angularjs

From Dev

Call function from another controller using Events in AngularJS

From Dev

ios 8 and Swift: call a function in another class from view controller

From Dev

Laravel call function from another controller during validation for Paypal payment

From Dev

How can I call a Sails.js controller's function from another function of the same controller?

From Dev

Call signalr from another controller

From Dev

call awakeFromNib from another controller

From Dev

Call signalr from another controller

From Dev

call awakeFromNib from another controller

From Dev

Call controller's method from another controller

From Dev

Symfony 2 - Call controller from another controller

From Dev

How to call a controller from another controller in codeigniter?

From Dev

How do I call a controller function from another controller in laravel 5.2?

From Dev

How to call a Method of Model from Controller in Zend Framework 3

From Dev

Call controller function from outside

From Dev

Call function in a Controller from Routes

From Dev

Call function or pass data to another controller AngularJS

From Dev

Call function or pass data to another controller AngularJS

From Dev

angularjs call another controller's function

From Dev

calling one function in a controller from another controller

From Dev

Call a function from function inside the same controller

Related Related

  1. 1

    How to call a controller function from another controller?

  2. 2

    iPhone - Call function from another view controller

  3. 3

    How to call a function from another controller in angularjs?

  4. 4

    Remove Index from indexController in zend framework application

  5. 5

    How to call a method of another controller in zend?

  6. 6

    AngularJS: Call controller update function from another controller or JS

  7. 7

    Call function from one controller to another controller using Factory in Angularjs

  8. 8

    How to call a function written in one controller from another controller in mvc

  9. 9

    Call a controller function of one module from controller of another module in angularjs

  10. 10

    Call function from another controller using Events in AngularJS

  11. 11

    ios 8 and Swift: call a function in another class from view controller

  12. 12

    Laravel call function from another controller during validation for Paypal payment

  13. 13

    How can I call a Sails.js controller's function from another function of the same controller?

  14. 14

    Call signalr from another controller

  15. 15

    call awakeFromNib from another controller

  16. 16

    Call signalr from another controller

  17. 17

    call awakeFromNib from another controller

  18. 18

    Call controller's method from another controller

  19. 19

    Symfony 2 - Call controller from another controller

  20. 20

    How to call a controller from another controller in codeigniter?

  21. 21

    How do I call a controller function from another controller in laravel 5.2?

  22. 22

    How to call a Method of Model from Controller in Zend Framework 3

  23. 23

    Call controller function from outside

  24. 24

    Call function in a Controller from Routes

  25. 25

    Call function or pass data to another controller AngularJS

  26. 26

    Call function or pass data to another controller AngularJS

  27. 27

    angularjs call another controller's function

  28. 28

    calling one function in a controller from another controller

  29. 29

    Call a function from function inside the same controller

HotTag

Archive