예제 #1
0
파일: Message.php 프로젝트: mcarral/html
 /**
  * Add a call to action (button) to the alert message
  *
  * @param string $text
  * @param string $url
  * @param string $class
  * @param array $parameters
  * @return \Styde\Html\Alert\Message $this
  */
 public function button($text, $url, $class = 'default', $parameters = array())
 {
     $this->message['buttons'][] = array('text' => $this->container->translate($text, $parameters), 'url' => $url, 'class' => $class);
     return $this;
 }
예제 #2
0
 /**
  * Attempts to translate texts if the translator component is set and the
  * lang key is found, otherwise returns the original text.
  *
  * @param $text
  * @param array $parameters
  * @return string 
  * @static 
  */
 public static function translate($text, $parameters = array())
 {
     return \Styde\Html\Alert\Container::translate($text, $parameters);
 }