English 中文(简体)
• 如何在面包所的另一个控制器中使用控制器方法?
原标题:How to access controller method in another controller in cakephp?
  • 时间:2012-05-02 04:55:10
  •  标签:
  • cakephp

我在B类中延长了A类,想在B类中使用A类方法。

问题回答

在两名控制员之间分享一种方法,将这一功能放在<代码>AppController。

分享一组与单一特征有关的方法:http://book.cake.org/2.0/en/ Controllers/components.html 它为该组织提供了适当的途径。





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签