Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#13468] - Added getHandlerSuffix(), setHandlerSuffix() in Dispatcher #13536

Merged
merged 2 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Added `Phalcon\Mvc\Router\RouteInterface::convert` so that calling `Phalcon\Mvc\Router\Group::add` will return an instance that has `convert` method [#13380](https://github.com/phalcon/cphalcon/issues/13380)
- Added `Phalcon\Mvc\ModelInterface::getModelsMetaData` [#13070](https://github.com/phalcon/cphalcon/issues/13402)
- Added `paginate()` method as a proxy of `getPaginate`. Added `previous` in the paginator object same as `before`. After 4.0 is released we will deprecate `getPaginate()`, `before` and `total_items` [#13492](https://github.com/phalcon/cphalcon/issues/13492)
- Added `getHandlerSuffix()`, `setHandlerSuffix()` in Dispatcher, `getTaskSuffix()`, `setTaskSuffix()` in the CLI Dispatcher [#13468](https://github.com/phalcon/cphalcon/issues/13468)
- Added ability to set a custom template for the Flash Messenger. [#13445](https://github.com/phalcon/cphalcon/issues/13445)

## Changed
Expand Down
16 changes: 16 additions & 0 deletions phalcon/cli/dispatcher.zep
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ class Dispatcher extends CliDispatcher implements DispatcherInterface
let this->_handlerName = taskName;
}

/**
* Sets the default task suffix
*/
public function setTaskSuffix(string taskSuffix)
{
let this->_handlerSuffix = taskSuffix;
}

/**
* Gets last dispatched task name
*/
Expand All @@ -90,6 +98,14 @@ class Dispatcher extends CliDispatcher implements DispatcherInterface
return this->_handlerName;
}

/**
* Gets the default task suffix
*/
public function getTaskSuffix() -> string
{
return this->_handlerSuffix;
}

/**
* Throws an internal exception
*/
Expand Down
5 changes: 5 additions & 0 deletions phalcon/cli/dispatcherinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ interface DispatcherInterface extends DispatcherInterfaceBase
*/
public function getTaskName() -> string;

/**
* Gets default task suffix
*/
public function getTaskSuffix() -> string;

/**
* Returns the latest dispatched controller
*/
Expand Down
16 changes: 16 additions & 0 deletions phalcon/dispatcher.zep
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ abstract class Dispatcher implements DispatcherInterface, InjectionAwareInterfac
return this->_returnedValue;
}

/**
* Sets the default suffix for the handler
*/
public function setHandlerSuffix(string handlerSuffix) -> void
{
let this->_handlerSuffix = handlerSuffix;
}

/**
* Enable model binding during dispatch
*
Expand Down Expand Up @@ -351,6 +359,14 @@ abstract class Dispatcher implements DispatcherInterface, InjectionAwareInterfac
return this;
}

/**
* Gets the default handler suffix
*/
public function getHandlerSuffix() -> string
{
return this->_handlerSuffix;
}

/**
* Gets model binder
*/
Expand Down
10 changes: 10 additions & 0 deletions phalcon/dispatcherinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@ interface DispatcherInterface
*/
public function getActionSuffix() -> string;

/**
* Gets the default handler suffix
*/
public function getHandlerSuffix() -> string;

/**
* Sets the default namespace
*/
public function setDefaultNamespace(string defaultNamespace);

/**
* Sets the default suffix for the handler
*/
public function setHandlerSuffix(string handlerSuffix);

/**
* Sets the default action name
*/
Expand Down