예제 #1
0
 /**
  * Constructor.
  *
  * @param	string target action url
  * @param	array hidden fields
  */
 public function __construct($url = '', array $hiddenFields = array(), $html5 = false)
 {
     ++self::$form_id;
     if ($url) {
         $this->httpAction = preg_match('#^http(s)?\\:\\/\\/#', $url) ? $url : COnfigure::siteurl($url);
     } else {
         $this->httpAction = Request::currenturl();
     }
     $this->hiddenFields = (array) $hiddenFields;
     $this->html5 = true === $html5 ? true : false;
 }
예제 #2
0
파일: layout.php 프로젝트: jamalsa/croogo
 /**
  * Feed
  *
  * RSS feeds
  *
  * @param boolean $returnUrl if true, only the URL will be returned
  * @return string
  */
 function feed($returnUrl = false)
 {
     if (Configure::read('Site.feed_url')) {
         $url = COnfigure::read('Site.feed_url');
     } else {
         /*$url = Router::url(array(
               'controller' => 'nodes',
               'action' => 'index',
               'type' => 'blog',
               'ext' => 'rss',
           ));*/
         $url = '/nodes/promoted.rss';
     }
     if ($returnUrl) {
         $output = $url;
     } else {
         $url = Router::url($url);
         $output = '<link href="' . $url . '" type="application/rss+xml" rel="alternate" title="RSS 2.0" />';
         return $output;
     }
     return $output;
 }