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.6 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.6
      • 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
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • Helper
  • HelperCollection
  • JsonView
  • MediaView
  • ScaffoldView
  • ThemeView
  • View
  • ViewBlock
  • XmlView
 1: <?php
 2: /**
 3:  * Scaffold.
 4:  *
 5:  * Automatic forms and actions generation for rapid web application development.
 6:  *
 7:  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 8:  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 9:  *
10:  * Licensed under The MIT License
11:  * For full copyright and license information, please see the LICENSE.txt
12:  * Redistributions of files must retain the above copyright notice.
13:  *
14:  * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15:  * @link          http://cakephp.org CakePHP(tm) Project
16:  * @package       Cake.View
17:  * @since         Cake v 0.10.0.1076
18:  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
19:  */
20: 
21: App::uses('View', 'View');
22: 
23: /**
24:  * ScaffoldView provides specific view file loading features for scaffolded views.
25:  *
26:  * @package Cake.View
27:  * @deprecated 3.0.0 Dynamic scaffolding will be removed and replaced in 3.0
28:  */
29: class ScaffoldView extends View {
30: 
31: /**
32:  * Override _getViewFileName Appends special scaffolding views in.
33:  *
34:  * @param string $name name of the view file to get.
35:  * @return string action
36:  * @throws MissingViewException
37:  */
38:     protected function _getViewFileName($name = null) {
39:         if ($name === null) {
40:             $name = $this->action;
41:         }
42:         $name = Inflector::underscore($name);
43:         $prefixes = Configure::read('Routing.prefixes');
44: 
45:         if (!empty($prefixes)) {
46:             foreach ($prefixes as $prefix) {
47:                 if (strpos($name, $prefix . '_') !== false) {
48:                     $name = substr($name, strlen($prefix) + 1);
49:                     break;
50:                 }
51:             }
52:         }
53: 
54:         if ($name === 'add' || $name === 'edit') {
55:             $name = 'form';
56:         }
57: 
58:         $scaffoldAction = 'scaffold.' . $name;
59: 
60:         if ($this->subDir !== null) {
61:             $subDir = strtolower($this->subDir) . DS;
62:         } else {
63:             $subDir = null;
64:         }
65: 
66:         $names[] = $this->viewPath . DS . $subDir . $scaffoldAction;
67:         $names[] = 'Scaffolds' . DS . $subDir . $name;
68: 
69:         $paths = $this->_paths($this->plugin);
70:         $exts = array($this->ext);
71:         if ($this->ext !== '.ctp') {
72:             $exts[] = '.ctp';
73:         }
74:         foreach ($exts as $ext) {
75:             foreach ($paths as $path) {
76:                 foreach ($names as $name) {
77:                     if (file_exists($path . $name . $ext)) {
78:                         return $path . $name . $ext;
79:                     }
80:                 }
81:             }
82:         }
83: 
84:         if ($name === 'Scaffolds' . DS . $subDir . 'error') {
85:             return CAKE . 'View' . DS . 'Errors' . DS . 'scaffold_error.ctp';
86:         }
87: 
88:         throw new MissingViewException($paths[0] . $name . $this->ext);
89:     }
90: 
91: }
92: 
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