コード例 #1
0
ファイル: IndexController.php プロジェクト: neilgarb/yadda
 public function indexAction()
 {
     $this->view->headMeta()->setName('description', 'Yadda (yet another daily deal aggregator) gathers into one space the daily deals and specials offered by South Africa\'s popular group buying websites.');
     $this->view->headLink()->appendStylesheet('/css/index/index.css');
     $this->view->regions = Yadda_Model_Region::index(false);
     $this->view->sites = Yadda_Model_Site::all();
     $this->view->featured = Yadda_Model_Deal::featured(3);
 }
コード例 #2
0
ファイル: IndexController.php プロジェクト: neilgarb/yadda
 public function indexAction()
 {
     $this->view->headTitle('yadda. yet another daily deal aggregator.', 'SET');
     $this->view->headMeta()->appendName('description', 'yadda. gathers into one space the daily deals from South Africa\'s favourite websites.');
     $this->view->regions = Yadda_Model_Region::index(false);
     $this->view->priceRanges = Yadda_Model_Deal::$priceRanges;
     $this->view->canonical = 'http://' . $this->view->config->domain->www . '/';
 }
コード例 #3
0
ファイル: DealController.php プロジェクト: neilgarb/yadda
 public function searchAction()
 {
     $params = array_merge(array('page' => 1), array_intersect_key($_GET, Yadda_Model_Deal::$allowedSearchParams), array('count' => 5));
     $this->view->results = Yadda_Model_Deal::search($params);
     $this->view->headTitle('yadda. - ' . $this->view->results['description'], 'SET');
     $this->view->regions = Yadda_Model_Region::index(false);
     $this->view->priceRanges = Yadda_Model_Deal::$priceRanges;
 }
コード例 #4
0
ファイル: DealController.php プロジェクト: neilgarb/yadda
 public function searchAction()
 {
     $params = array_intersect_key($_GET, Yadda_Model_Deal::$allowedSearchParams);
     // data for search form
     $this->view->regions = Yadda_Model_Region::index();
     // results
     $result = Yadda_Model_Deal::search(array_merge($params, array('count' => 30)));
     $this->view->deals = $result;
     $this->view->params = $params;
     $title = $this->view->deals['description'];
     $this->view->headTitle('yadda. - ' . $title, 'SET');
     $this->view->title = $title;
     $this->view->headLink()->appendStylesheet('/css/deal/search.css');
     $this->view->rss = $this->view->url(array(), 'rss') . '?' . http_build_query(array_diff_key($params, array('count' => null, 'page' => null)));
 }
コード例 #5
0
ファイル: Edit.php プロジェクト: neilgarb/yadda
 public function __construct($deal)
 {
     parent::__construct();
     $this->setAction('/deal/edit/id/' . $deal['id']);
     $this->addElements(array('title' => array('type' => 'text', 'options' => array('label' => 'Title')), 'description' => array('type' => 'textarea', 'options' => array('label' => 'Description', 'rows' => 10, 'cols' => 60)), 'site' => array('type' => 'select', 'options' => array('label' => 'Site', 'multiOptions' => Yadda_Model_Site::index(true))), 'region' => array('type' => 'select', 'options' => array('label' => 'Region', 'multiOptions' => Yadda_Model_Region::index(true))), 'price' => array('type' => 'text', 'options' => array('label' => 'Price (R)', 'class' => 'short')), 'value' => array('type' => 'text', 'options' => array('label' => 'Value (R)', 'class' => 'short')), 'discount' => array('type' => 'text', 'options' => array('label' => 'Discount (%)', 'class' => 'short')), 'lat' => array('type' => 'text', 'options' => array('label' => 'Latitude', 'class' => 'short')), 'long' => array('type' => 'text', 'options' => array('label' => 'Longitude', 'class' => 'short')), 'submit' => array('type' => 'submit', 'options' => array('label' => 'Submit'))));
 }
コード例 #6
0
ファイル: New.php プロジェクト: neilgarb/yadda
 public function __construct()
 {
     parent::__construct();
     $this->setAction('/feed/new');
     $this->addElements(array('site' => array('type' => 'select', 'options' => array('label' => 'Site', 'multiOptions' => Yadda_Model_Site::index(true))), 'region' => array('type' => 'select', 'options' => array('label' => 'Region', 'multiOptions' => Yadda_Model_Region::index(true))), 'engine' => array('type' => 'select', 'options' => array('label' => 'Engine', 'multiOptions' => array('' => '') + Yadda_Model_Feed::$engines)), 'url' => array('type' => 'text', 'options' => array('label' => 'URL', 'attribs' => array('placeholder' => 'http://'))), 'submit' => array('type' => 'submit', 'options' => array('label' => 'Submit'))));
 }