Subversion Repositories SmartDukaan

Rev

Rev 13565 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13532 anikendra 1
<?php
2
App::uses('AppController', 'Controller');
3
 
4
/**
5
 * Static content controller
6
 *
7
 * Override this controller by placing a copy in controllers directory of an application
8
 *
9
 * @package       app.Controller
10
 * @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html
11
 */
12
class PagesController extends AppController {
13
 
14
/**
15
 * This controller does not use a model
16
 *
17
 * @var array
18
 */
19
	public $uses = array();
20
 
21
	public $components = array('Paginator','RequestHandler');
22
/**
23
 * Displays a view
24
 *
25
 * @param mixed What page to display
26
 * @return void
27
 * @throws NotFoundException When the view file could not be found
28
 *	or MissingViewException in debug mode.
29
 */
30
	public function display() {
31
		if($this->request->is('ajax')){
32
			$this->layout = 'ajax';
33
		}
34
		$this->loadModel('Album');
35
		$path = func_get_args();
36
 
37
		$count = count($path);
38
		if (!$count) {
39
			return $this->redirect('/');
40
		}
41
		$page = $subpage = $title_for_layout = null;
42
 
43
		if (!empty($path[0])) {
44
			$page = $path[0];
45
		}
46
		if (!empty($path[1])) {
47
			$subpage = $path[1];
48
		}
49
		if (!empty($path[$count - 1])) {
50
			$title_for_layout = Inflector::humanize($path[$count - 1]);
51
		}
52
		$title_for_layout = "Get Cashback on favourite";
53
		$description = "Get cashback on your favourite products.Mouth watering deals";
54
 
55
		//Load the most viewed videos
56
		$this->set(compact('page', 'subpage', 'title_for_layout', 'description', 'authurl'));
57
		try {
58
			$this->render(implode('/', $path));
59
		} catch (MissingViewException $e) {
60
			if (Configure::read('debug')) {
61
				throw $e;
62
			}
63
			throw new NotFoundException();
64
		}
65
	}
66
}