本文整理汇总了PHP中Action::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::execute方法的具体用法?PHP Action::execute怎么用?PHP Action::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Resource methods
*/
public function get()
{
$action = new Action('common/currency');
$data = $action->execute($this->registry);
$response['currencies'] = $this->processCurrencies($data['currencies']);
$this->response->setOutput($response);
}
示例2: get
/**
* Resource methods
*/
public function get()
{
$action = new Action('common/language');
$data = $action->execute($this->registry);
$response['languages'] = $this->processLanguages($data['languages']);
$this->response->setOutput($response);
}
示例3: get
public function get()
{
$action = new Action('common/length');
$data = $action->execute($this->registry);
$response['length_units'] = $data['length_units'];
$this->response->setOutput($response);
}
示例4: index
public function index()
{
// Route
if (isset($this->request->get['route'])) {
$route = $this->request->get['route'];
} else {
$route = 'common/dashboard';
}
$data = array();
// Sanitize the call
$route = str_replace('../', '', (string) $route);
// Trigger the pre events
$result = $this->event->trigger('controller/' . $route . '/before', array(&$route, &$data));
if (!is_null($result)) {
return $result;
}
$action = new Action($route);
// Any output needs to be another Action object.
$output = $action->execute($this->registry, $data);
// Trigger the post events
$result = $this->event->trigger('controller/' . $route . '/after', array(&$route, &$output));
if (!is_null($result)) {
return $result;
}
return $output;
}
示例5: index
public function index()
{
// Route
if (isset($this->request->get['route']) && $this->request->get['route'] != 'startup/router') {
$route = $this->request->get['route'];
} else {
$route = $this->config->get('action_default');
}
$data = array();
// Sanitize the call
$route = preg_replace('/[^a-zA-Z0-9_\\/]/', '', (string) $route);
// Trigger the pre events
$result = $this->event->trigger('controller/' . $route . '/before', array(&$route, &$data));
if (!is_null($result)) {
return $result;
}
$action = new Action($route);
// Any output needs to be another Action object.
$output = $action->execute($this->registry, $data);
// Trigger the post events
$result = $this->event->trigger('controller/' . $route . '/after', array(&$route, &$output));
if (!is_null($result)) {
return $result;
}
return $output;
}
示例6: index
public function index()
{
// Route
if (isset($this->request->get['route']) && $this->request->get['route'] != 'startup/router') {
$route = $this->request->get['route'];
} else {
$route = $this->config->get('action_default');
}
// Sanitize the call
$route = str_replace('../', '', (string) $route);
// Trigger the pre events
$result = $this->event->trigger('controller/' . $route . '/before', array(&$route, &$data));
if (!is_null($result)) {
return $result;
}
// We dont want to use the loader class as it would make an controller callable.
$action = new Action($route);
// Any output needs to be another Action object.
$output = $action->execute($this->registry);
// Trigger the post events
$result = $this->event->trigger('controller/' . $route . '/after', array(&$route, &$data, &$output));
if (!is_null($result)) {
return $result;
}
return $output;
}
示例7: execute
public function execute()
{
$moduleMetadata = parent::execute();
$columns = array();
$values = array();
foreach ($moduleMetadata['fields'] as $field => $def) {
$name = $field;
if (!empty($def['name'])) {
$name = $def['name'];
}
if (!$this->source->existParam($name)) {
continue;
}
$columns[] = $name . ' = :' . $name;
$values[':' . $name] = $this->source->getParam($name);
}
$q = "UPDATE :table SET :columns WHERE id = :id";
$sql = strtr($q, array(':table' => $this->table, ':columns' => implode(', ', $columns)));
$stmt = $this->pdo->prepare($sql);
$values[':id'] = $this->id;
foreach ($values as $name => $value) {
$stmt->bindValue($name, $value);
}
$stmt->execute();
}
示例8: controller
public function controller($route, $args = array())
{
$this->trigger->fire('pre.load.controller', array(&$route, &$args));
$action = new Action($route, $args);
$ret = $action->execute($this->registry);
$this->trigger->fire('post.load.controller', array(&$route, &$ret));
return $ret;
}
示例9: controller
public function controller($route, $args = array())
{
if ($this->factory) {
$action = $this->factory->newAction($route, $args);
} else {
$action = new Action($route, $args);
}
return $action->execute($this->registry);
}
示例10: trigger
public function trigger($key, &$arg = array()) {
if (isset($this->data[$key])) {
usort($this->data[$key], array("Event", "cmpByPriority"));
foreach ($this->data[$key] as $event) {
$action = new Action($event['action'], $arg);
$action->execute($this->registry);
}
}
}
示例11: trigger
/**
* @param string $key
* @param array $arg
*
* @return void
*/
public function trigger($key, &$arg = array())
{
if (isset($this->data[$key])) {
foreach ($this->data[$key] as $event) {
$action = new Action($event, $arg);
$action->execute($this->registry);
}
}
}
示例12: confirmPayment
protected function confirmPayment($paymentMethodCode)
{
// Do not intercept view data because the mail send to user when confirming the order
// may contain html from templates which are loaded through the loader's view method.
$this->load->setInterceptViewData(false);
// Internally execute the confirmation route.
$action = new Action($this->payment->getPaymentConfirmationRoute($paymentMethodCode));
$action->execute($this->registry);
}
示例13: controller
public function controller($route)
{
// function arguments
$args = func_get_args();
// Remove the route
array_shift($args);
$action = new Action($route, $args);
return $action->execute($this->registry);
}
示例14: testProductUrlRewrite
public function testProductUrlRewrite()
{
$this->db->query("INSERT INTO `" . DB_PREFIX . "url_alias` SET query = 'product_id=1', keyword = 'product-1'");
$this->config->set('config_seo_url', 1);
$urlAction = new Action('common/seo_url');
$urlAction->execute($this->registry);
$link = $this->url->link('product/product', 'product_id=1');
$this->db->query("DELETE FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=1'");
$this->assertEquals(HTTPS_SERVER . 'product-1', $link, "Could not construct URL's alias");
}
示例15: get
/**
* Resource methods
*/
public function get($id = NULL)
{
$settings = array();
$settings['limit'] = isset($this->request->get['limit']) ? $this->request->get['limit'] : self::DEFAULT_LIMIT;
$settings['width'] = isset($this->request->get['image_width']) ? $this->request->get['image_width'] : self::DEFAULT_IMAGE_WIDTH;
$settings['height'] = isset($this->request->get['image_height']) ? $this->request->get['image_height'] : self::DEFAULT_IMAGE_HEIGHT;
$action = new Action('module/latest', $settings);
$data = $action->execute($this->registry);
$latestProducts = array('products' => $this->getLatestProducts($data));
$this->response->setOutput($latestProducts);
}