Unexisting eylemleri ele alma?

2 Cevap php

Zend Framework unexisting eylemleri işlemek için en iyi yolu nedir?

Kontrolöre bağlı olarak ben farklı isteği işlemek mümkün istiyorum.

BR Niklas

2 Cevap

Controller sınıfına bu işlevi ekle

public function __call($method, $args){

    if ('Action' == substr($method, -6) && $method != 'indexAction') {
        // If the action method was not found, forward to the index action
        return $this->_forward('index');
    }

    // all other methods throw an exception
    throw new Exception('Invalid method "' . $method . '" called', 500);
}

Bu durumda eksik eylemler endeksi eylem iletilir