CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.0 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.0
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Auth
    • Core
    • Error
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
    • Network
      • Email
      • Http
    • Routing
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • AppController
  • CakeErrorController
  • Component
  • ComponentCollection
  • Controller
  • PagesController
  • Scaffold
 1: <?php
 2: /**
 3:  * Static content controller.
 4:  *
 5:  * This file will render views from views/pages/
 6:  *
 7:  * PHP 5
 8:  *
 9:  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
10:  * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
11:  *
12:  * Licensed under The MIT License
13:  * Redistributions of files must retain the above copyright notice.
14:  *
15:  * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
16:  * @link          http://cakephp.org CakePHP(tm) Project
17:  * @package       Cake.Controller
18:  * @since         CakePHP(tm) v 0.2.9
19:  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
20:  */
21: 
22: App::uses('AppController', 'Controller');
23: 
24: /**
25:  * Static content controller
26:  *
27:  * Override this controller by placing a copy in controllers directory of an application
28:  *
29:  * @package       Cake.Controller
30:  * @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html
31:  */
32: class PagesController extends AppController {
33: 
34: /**
35:  * Default helper
36:  *
37:  * @var array
38:  */
39:     public $helpers = array('Html', 'Session');
40: 
41: /**
42:  * This controller does not use a model
43:  *
44:  * @var array
45:  */
46:     public $uses = array();
47: 
48: /**
49:  * Displays a view
50:  *
51:  * @param mixed What page to display
52:  * @return void
53:  */
54:     public function display() {
55:         $path = func_get_args();
56: 
57:         $count = count($path);
58:         if (!$count) {
59:             $this->redirect('/');
60:         }
61:         $page = $subpage = $title_for_layout = null;
62: 
63:         if (!empty($path[0])) {
64:             $page = $path[0];
65:         }
66:         if (!empty($path[1])) {
67:             $subpage = $path[1];
68:         }
69:         if (!empty($path[$count - 1])) {
70:             $title_for_layout = Inflector::humanize($path[$count - 1]);
71:         }
72:         $this->set(compact('page', 'subpage', 'title_for_layout'));
73:         $this->render(implode('/', $path));
74:     }
75: }
76: 
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs