if($this->isSearch && 1==3):
$commandArgBuilder = $this->pageBuilder->getCommandArgBuilder();
$searchForm=$this->sm()->get('Search\Form\SearchForm');
$searchCommandArgProcessor=$this->sm()->get('Tut\Repository\Sphinx\CommandArgProcessor\Search');
$this->pageBuilder->addCommandArgProcessor($searchCommandArgProcessor);
$searchArg= $searchCommandArgProcessor->setSearchForm($searchForm);
$commandArgBuilder->add($searchArg);
$searchArg = $commandArgBuilder->getBuiltArg('search');
endif;
if($this->isSearch && $searchArg->isValid() && !$searchArg->hasSearchText()):
$this->realUrl=$this->url()->fromRoute('tut/public/listing', []);
$e->getRouteMatch()->setParam('action', 'permanentlyMoved');
elseif($this->isSearch && $searchArg->isValid()):
$e->getRouteMatch()->setParam('action', 'searchListing');
$this->sm()->get('Search\Service\SitewideSearch')->setSearchForm($searchForm, 'tut');
endif;
}
public function notFoundHereAction(){
$r=new ViewModel();
Arguments
"Call to a member function isValid() on null"
$this->member=$member;
return $this;
}
final protected function setAdmin(\User\Lib\Admin $admin){
$this->admin=$admin;
return $this;
}
final protected function isAdmin(){
return (isset($this->admin) && is_object($this->admin))?true:false;
}
final protected function isMember(){
return (isset($this->member) && is_object($this->member))?true:false;
}
final public function onDispatch(MvcEvent $e)
{
$this->dispatchEvent = $e;
$this->dispatchEvent($e);
return parent::onDispatch($e); // TODO: Change the autogenerated stub
}
//override if needed: called to delegate a service to createRealService method
public function di(ContainerInterface $c){
// do nothing
}
//override if needed: called to inject Dependency Injection
public function getService()
{
//do nothing
}
//override if needed: called when the controller is being dispatched
public function dispatchEvent(MvcEvent $e){
//do nothing
Arguments
Laminas\Mvc\MvcEvent {#431}
}
if ($this->sharedManager) {
foreach ($this->sharedManager->getListeners($this->identifiers, $name) as $priority => $listeners) {
$listOfListenersByPriority[$priority][] = $listeners;
}
}
// Sort by priority in reverse order
krsort($listOfListenersByPriority);
// Initial value of stop propagation flag should be false
$event->stopPropagation(false);
// Execute listeners
$responses = new ResponseCollection();
foreach ($listOfListenersByPriority as $listOfListeners) {
foreach ($listOfListeners as $listeners) {
foreach ($listeners as $listener) {
$response = $listener($event);
$responses->push($response);
// If the event was asked to stop propagating, do so
if ($event->propagationIsStopped()) {
$responses->setStopped(true);
return $responses;
}
// If the result causes our validation callback to return true,
// stop propagation
if ($callback && $callback($response)) {
$responses->setStopped(true);
return $responses;
}
}
}
}
return $responses;
}
Arguments
Laminas\Mvc\MvcEvent {#431}
$event->setParams($argv);
}
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function triggerEvent(EventInterface $event)
{
return $this->triggerListeners($event);
}
/**
* @inheritDoc
*/
public function triggerEventUntil(callable $callback, EventInterface $event)
{
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function attach($eventName, callable $listener, $priority = 1)
{
if (! is_string($eventName)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string for the event; received %s',
__METHOD__,
is_object($eventName) ? $eventName::class : gettype($eventName)
));
}
$this->events[$eventName][(int) $priority][0][] = $listener;
return $listener;
}
/**
Arguments
Laminas\Mvc\MvcEvent {#431}
Closure($test): bool {#1068 …4}
* @events dispatch.pre, dispatch.post
* @param Request $request
* @param null|Response $response
* @return Response|mixed
*/
public function dispatch(Request $request, Response $response = null)
{
$this->request = $request;
if (! $response) {
$response = new HttpResponse();
}
$this->response = $response;
$e = $this->getEvent();
$e->setName(MvcEvent::EVENT_DISPATCH);
$e->setRequest($request);
$e->setResponse($response);
$e->setTarget($this);
$result = $this->getEventManager()->triggerEventUntil(static fn($test): bool => $test instanceof Response, $e);
if ($result->stopped()) {
return $result->last();
}
return $e->getResult();
}
/**
* Get request object
*
* @return Request
*/
public function getRequest()
{
if (! $this->request) {
$this->request = new HttpRequest();
}
return $this->request;
Arguments
Closure($test): bool {#1068 …4}
Laminas\Mvc\MvcEvent {#431}
);
return $this->complete($return, $e);
} catch (Throwable $exception) {
$return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
return $this->complete($return, $e);
} catch (Exception $exception) { // @TODO clean up once PHP 7 requirement is enforced
$return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
return $this->complete($return, $e);
}
if ($controller instanceof InjectApplicationEventInterface) {
$controller->setEvent($e);
}
$request = $e->getRequest();
$response = $application->getResponse();
$caughtException = null;
try {
$return = $controller->dispatch($request, $response);
} catch (Throwable $ex) {
$caughtException = $ex;
} catch (Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
$caughtException = $ex;
}
if ($caughtException !== null) {
$e->setName(MvcEvent::EVENT_DISPATCH_ERROR);
$e->setError($application::ERROR_EXCEPTION);
$e->setController($controllerName);
$e->setControllerClass($controller::class);
$e->setParam('exception', $caughtException);
$return = $application->getEventManager()->triggerEvent($e)->last();
if (! $return) {
$return = $e->getResult();
}
}
return $this->complete($return, $e);
Arguments
Laminas\Http\PhpEnvironment\Request {#408}
Laminas\Http\PhpEnvironment\Response {#418}
}
if ($this->sharedManager) {
foreach ($this->sharedManager->getListeners($this->identifiers, $name) as $priority => $listeners) {
$listOfListenersByPriority[$priority][] = $listeners;
}
}
// Sort by priority in reverse order
krsort($listOfListenersByPriority);
// Initial value of stop propagation flag should be false
$event->stopPropagation(false);
// Execute listeners
$responses = new ResponseCollection();
foreach ($listOfListenersByPriority as $listOfListeners) {
foreach ($listOfListeners as $listeners) {
foreach ($listeners as $listener) {
$response = $listener($event);
$responses->push($response);
// If the event was asked to stop propagating, do so
if ($event->propagationIsStopped()) {
$responses->setStopped(true);
return $responses;
}
// If the result causes our validation callback to return true,
// stop propagation
if ($callback && $callback($response)) {
$responses->setStopped(true);
return $responses;
}
}
}
}
return $responses;
}
Arguments
Laminas\Mvc\MvcEvent {#431}
$event->setParams($argv);
}
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function triggerEvent(EventInterface $event)
{
return $this->triggerListeners($event);
}
/**
* @inheritDoc
*/
public function triggerEventUntil(callable $callback, EventInterface $event)
{
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function attach($eventName, callable $listener, $priority = 1)
{
if (! is_string($eventName)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string for the event; received %s',
__METHOD__,
is_object($eventName) ? $eventName::class : gettype($eventName)
));
}
$this->events[$eventName][(int) $priority][0][] = $listener;
return $listener;
}
/**
Arguments
Laminas\Mvc\MvcEvent {#431}
Closure($r): bool {#2 …4}
$response = $result->last();
if ($response instanceof ResponseInterface) {
$event->setName(MvcEvent::EVENT_FINISH);
$event->setTarget($this);
$event->setResponse($response);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
$this->response = $response;
return $this;
}
}
if ($event->getError()) {
return $this->completeRequest($event);
}
// Trigger dispatch event
$event->setName(MvcEvent::EVENT_DISPATCH);
$event->stopPropagation(false); // Clear before triggering
$result = $events->triggerEventUntil($shortCircuit, $event);
// Complete response
$response = $result->last();
if ($response instanceof ResponseInterface) {
$event->setName(MvcEvent::EVENT_FINISH);
$event->setTarget($this);
$event->setResponse($response);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
$this->response = $response;
return $this;
}
$response = $this->response;
$event->setResponse($response);
return $this->completeRequest($event);
}
/**
* Complete the request
Arguments
Closure($r): bool {#2 …4}
Laminas\Mvc\MvcEvent {#431}
} catch(Exception $e) {
//var_dump(debug_backtrace());
$gtgggg=[];
$gtgggg['err']=$e->getMessage();
$gtgggg['line']=$e->getLine();
$gtgggg['file']=$e->getFile();
$gtgggg['trace']=$e->getTrace();
$gtgggg['code']=$e->getCode();
d($gtgggg);
}
else:
Application::init(require 'config/' . PROJECT_ID_STRING . '/application.config.php')->run();
endif;