Sign In!
|
New User?Signup Now!
|
Forgot password?
Source Code 4 you
Home
Create Forum Topic
Check WebSite Rank
Publish Articles
UV Web Booster
Contact
Forum Type
Search Engine
.Net C# VB F# VC++
MonoPoject
Java J2EE
Zand Php Cake Php
Oracle Database Server
Mysql Database Server
DB2 Database Server
MSSql Databse Server
Javascript Ajax
Html Xml Xhtml
C Programming
C++ Programming
D Programming
CGI Programming
Perl Programming
Cobol Programming
Pascal Programming
Ruby Programming
Drupal Programming
Automobile
Software Testing
Linux Unix Mac Sun OS
Embedded Systems
Mainframe
IC Microcircuit Chip
Electronics Electrical
Hardware Netwarking
SAP ERP
Logical Reasoning
Human Resources
Science
Agriculture
Accounting
History
Pharmaceutical
Other Topic
Zand Php Cake Php
Posted by :
Michael Gaiser
How to inheirt form other controllers?
I want to have my UserAdmin controller inherit from my User
controller instead of AppController. but it cannot seem to find it. Is
there a special way to do this in cake or can I just use and include
statment? Thanks.
~MJG
Posted by :
Graham Weldon
Re : How to inheirt form other controllers?
Try something like:
if (!class_exists('
ParentController')) {
App::import('Controller', 'ParentController');
}
class ChildController extends ParentController {
// Imeplement controller as normal
}
Posted by :
brian
Re : How to inheirt form other controllers?
Have a look at admin routing. You don't need to have separate
controllers for what you want to do.
Posted by :
Grzegorz Pawlik
Re : How to inheirt form other controllers?
> *Fatal error*: Class 'LocationController' not found in *
> C:\wamp\www\theinconnu\app\
controllers\locationmanager_
controller.php* on
> line *6
It seems You are importing LocationmanagerController (in app::import),
but
extending class by LocationController, or making some similar
mistake.
Plus, controllers are supposed to be plural, like LocationsController
instead of LocationController and so, maybe this is Your typo?
>
> *So for the parent controller name, do I use 'Location' or
> 'LocationController'?
>
Posted by :
Michael Gaiser
Re : How to inheirt form other controllers?
Yep. It was part typo as well as me trying to use it wrong. Thanks for the help.
~MJG
Posted by :
Jaydeep Dave
Re : How to inheirt form other controllers?
You can use that controller (Model) in app_controller.php;
var $uses = array('User', 'Curl', 'Services'); // etc ;)
---------------
In your "end" controller you can use something like
$this->User->Controller->
method(); // Dont know the exact snippet ... but search in google.
If you have the better reply, then send it to us. We will display your reply after the approval.
Name :
Email Id :
Reply :