php+;zend..在请求中传递参数

php+;zend..在请求中传递参数,php,model-view-controller,smarty,Php,Model View Controller,Smarty,我想在添加操作中传递参数。也就是说,如果单击菜单项中的所有者,则默认情况下应设置“is_owner”,否则将重置。除了“add”之外,我还想发送一个参数并在视图中访问它。这是request dispatcher $router->map('Company','Company',array('controller'=>'companys','action'=>'add')) 这是控制器类中的添加操作 function add() { if($this->request->isAp

我想在添加操作中传递参数。也就是说,如果单击菜单项中的所有者,则默认情况下应设置“is_owner”,否则将重置。除了“add”之外,我还想发送一个参数并在视图中访问它。这是request dispatcher

$router->map('Company','Company',array('controller'=>'companys','action'=>'add'))

这是控制器类中的添加操作

 function add() {
  if($this->request->isApiCall() && !$this->request->isSubmitted()) {
    $this->httpError(HTTP_ERR_BAD_REQUEST, null, true, true);
  } // if

  if(!Company::canAdd($this->logged_user)) {
    $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());
  } // if

  $company = new Company();
  $options = array('office_address', 'office_phone', 'office_fax', 'office_homepage','office_is_owner');

  $company_data = $this->request->post('company');
  $this->smarty->assign(array(
    'company_data' => $company_data,
    'active_company' => $company,
  ));

  if ($this->request->isSubmitted()) {
   db_begin_work();

   $company = new Company();
   $company->setAttributes($company_data);
   $company->setIsOwner(false);

    $save = $company->save();

    if($save && !is_error($save)){
      foreach($options as $option) {
        $value = trim(array_var($company_data, $option));

        if($option == 'office_homepage' && $value && strpos($value, '://') === false) {
          $value = 'http://' . $value;
        } // if

        if($value != '') {
          CompanyConfigOptions::setValue($option, $value, $company);
        } // if
      } // foreach

      db_commit();

      if($this->request->getFormat() == FORMAT_HTML) {
       flash_success("Company ':name' has been created", array('name' => $company->getName()));
       $this->redirectToUrl($company->getViewUrl());
      } else {
       $this->serveData($company, 'company');
      } // if
    } else {
      db_rollback();

     if($this->request->getFormat() == FORMAT_HTML) {
      $this->smarty->assign('errors', $save);
     } else {
      $this->serveData($save);
     } // if
    } // if
  } // if
} // add

plz plz plz help me

您不能将附加参数与控制器和操作一起传递吗

$router->map('Company', 'Company', array(
     'controller' => 'companies',
     'action' => 'add',
     'paramkey' => 'paramvalue',
     'anotherparam' => 'anothervalue'));

这些信息随后会显示在请求中,但可能不会显示为post。当您传递这些参数时,尝试查看控制器的$this->请求是什么样子。

我尝试了tht way.bt我需要访问控制器类中的tht值。我应该如何访问?
$router->map('Company', 'Company', array(
     'controller' => 'companies',
     'action' => 'add',
     'paramkey' => 'paramvalue',
     'anotherparam' => 'anothervalue'));