English 中文(简体)
我们在闪闪电中如何使用不止一个信息 采用公有框架的使者
原标题:How do we use more than one message in flashMessenger using zend framework

我使用了zen。 我有以下法典:

....
$cust =  test@test.com ;
$list.= Also Sent Mail to following members ;
                foreach($m_list as $value)
                {
                $mail_to_manu = new Zend_Mail( utf-8 );                    
                $mail_to_manu->clearFrom();                    
                $mail_to_manu->setBodyHtml( Text )
                ->setFrom( noreply@test.com ,  test admin )
                ->addTo($value[ email ])
                ->setSubject( Test );
                $mail_to_manu->send();       
                $list.=$value[ manufacturers_email ]. <br/> ;
                } 
                $this->_helper->flashMessenger->addMessage( Mail send to  . $cust.   Successfully .$list);
        $this->_redirector->gotoUrl( /index );    
.....

我发出任何突破的信息。 我的祝福。

Mail send to test@test.com Successfully Also Sent Mail to following members some1@example.com some2@example.com...

我的发言也一样。

 Mail send to test@test.com Successfully 
 Also Sent Mail to following members,
 some1@example.com
 some2@example.com
 ...

因此,我需要相互分离。 能够在闪电投递中做到这一点。 如果是,Kindly建议。

问题回答

您使用<代码>strip_tags 或者在文字上类似? 它可以使<代码><br />的标签脱掉。

还可通过电话<>flashMessenger->addMessage(,每次地址一次添加多个信息:

$cust =  test@test.com ;
$this->_helper->flashMessenger->addMessage( Mail send to  . $cust.   Successfully );
if(count($m_list)>0 )
    $this->_helper->flashMessenger->addMessage( Also Sent Mail to following members );
foreach($m_list as $value)
{
    $mail_to_manu = new Zend_Mail( utf-8 );                    
    $mail_to_manu->clearFrom();                    
    $mail_to_manu->setBodyHtml( Text )
    ->setFrom( noreply@test.com ,  test admin )
    ->addTo($value[ email ])
    ->setSubject( Test );
    $mail_to_manu->send();       
    $this->_helper->flashMessenger->addMessage($value[ manufacturers_email ]);
} 
$this->_redirector->gotoUrl( /index );    

Your question

为什么要合并在一起,这就是:请在无附加标记的情况下重新编号<>echo>/code>。

诸如:

foreach ($this->messages as $message)
{
    echo  <p class="message">  . $this->escape($message) .  </p> ;
}

但是,事实上,在意见中处理闪电问题的方法要好得多。 如你所知,泽斯德采特·梅森格是行动帮助者。 但是,还有一种可观的助手,有助于你准确地传递你的信息。 最好通过<条码>通知(警告=>); 这是一种警告:,阵列钥匙(警报)将作为<代码><p>标签的类别。 可查阅,关于Carton/2006/10 s blog

Your variable naming needs improvement

  • Write readable variable names like $customer instead of just $cust. Nobody ever said shortening variable names is a means of writing lean code ;). Shortening variable names is bad (code smell) because it make code less readable for others and for yourself in the future.
  • Use casing like this $mailToManufacturer instead of using underscores. It s a general agreement (standard) and therefore good for readability and understanding of code too.




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签