Questions tagged with controller

2 answers

1 vote

Asked by saschaappel, on 30/12/09 in

$this->Auth->loginAction = 'members/login'; not works

Dear All

I try to change the default users/login to members/login.

I have aded the $this-Auth-loginAction = 'Members/login'; to appController beforeFilter() like:

class AppController extends Controller {

var $components = array('auth');

function...

1 answer

0 votes

Asked by tekcorap, on 1/4/10 in

always use singular model and controller names

Hi everyone, I have a small problem. I'm using CakePHP 1.2.6.

Unfortunately, not as in English plurals in Turkish. eg

"makale"(article) in the plural of the word Turkish "makaleler" (not

articles). Create a model when I check the articles CakePHP...

2 answers

0 votes

Asked by neuromancer, on 24/3/10 in

$this->data['index_name'] not being sent to controller

Hi,

Currently my code in the view looks like this:


<select id="data['capture_year']" name="data['capture_year']">
<?php 	foreach($years as $y){
	?> <option value = "<?php echo $y;?>"<?php if($y == this->data['capture_year']) {                     ...

3 answers

0 votes

Asked by dimis283, on 19/2/10 in

$this->redirect, set parameter

I want to use $this-redirect but I want also to pas a $_get parameter.

For example mysite/controller/action/4

Now I use this

$this-redirect(array('action' = 'index/'.$this-data['Art']['cat_id']));

But I thing there must be a better solution.Is not...

1 answer

0 votes

Asked by pokoot, on 23/3/10 in

A simple question on app_controller.php

First of all thank you for taking time to read my problem.

I've created a class /app/app_controller.php and an error page at /app/views/errors/maintenance.ctp.

The problem is the cakeError does not seem to work. Does anyone here know something to...

1 answer

0 votes

Asked by Ranilson, on 11/3/10 in

Add a record and update another table

Hi everyone,

I would like to know how to add a record to one specific table and, after doing that, update another table's field, but I need to do that using the same action.

Thanks

1 answer

0 votes

Asked by Ranilson, on 11/3/10 in

Add a record and update another table

Hi everyone,

I would like to know how to add a record to one specific table and, after doing that, update another table's field, but I need to do that using the same action.

Thanks

2 answers

0 votes

Asked by Alevsk, on 23/4/10 in

add another field after baking

Hello, its me again, now im developing a aplication from a school, I create the aplicacion with cake bake, but now I need to add another field called "phone number", I add directly in the database with phpmyadmin, and modify the views and create...

0 answers

0 votes

Asked by irawoodring, on 16/2/10 in

Adding a button

I'm not sure how to ask exactly what I'm trying to ask...

I want to add a button to a view that will query a php script on my backend, and then update fields in the add/edit view accordingly. For instance, a user will click the add button to add...

3 answers

0 votes

Asked by PawełMysior, on 12/2/10 in

Admin routing, http://website.com/admin won't go to posts/admin_index

I have admin routing enabled. How can I set routing, to make http://website.com/admin go to posts/admin_index?

I've got this:


Router::connect('/', array('controller' => 'posts', 'action' => 'index'));

But it doesn't seem to work. I get this error...

2 answers

2 votes

Asked by mmhan.blogspot.com, on 4/12/09 in

Ajax Request

How do I know if a request was made from ajax or it was a normal web request?

I just wanted to block off the view, if it wasn't an ajax request.

1 answer

0 votes

Asked by pastryking, on 17/6/10 in

Ajax view problem (nothing in the view showing)

I created a function in my controller called addToPlaylist($songName). I wanted to add these song names to an array and then a session variable using an Ajax call. The first time i did this i got an error saying i do not have a template file to...

1 answer

2 votes

Asked by codexispoetry, on 30/11/09 in

Allowing __call in AppController

Hi.

PHP5 has a __call magic method that is triggered when invoking inaccessible methods in an object context. I tried using this function as a catch-all for my missing actions, but realized that the Dispatcher checks controller classes for the...

0 answers

0 votes

Asked by washington, on 26/4/10 in

An Array that is very big

Hi all,

I was trying to store up all the matched data retrieved from a Table:

$u = $this-Test-query("SELECT * FROM Test Where any='$a%'");

But the result of debug($u) is something like this:

Array

(

)

Which was not what I had expected to see like...

1 answer

0 votes

Asked by washington, on 26/4/10 in

An Array that is very big

Hi all,

I was trying to store up all the matched data retrieved from a Table:

$u = $this-Test-query("SELECT * FROM Test Where any='$a%'");

But the result of debug($u) is something like this:

Array

(

)

Which was not what I had expected to see like...

0 answers

0 votes

Asked by nutbutter, on 2/5/10 in

App::import

I'm having trouble using App::import for vendor files on my remote server. Every time I try to import a vendor file I get this error:


Fatal error: Class 'classname' not found in /path/to/controller.php on line xx

It works on my local server, but...

1 answer

0 votes

Asked by Rahu1, on 1/4/10 in

Associations using hasMany

I have the following models with their associations

post hasMany comment

user hasMany comment

comment belongsTo post and user

when i paginate using the following code the result does not come out as i want it to.

$this-paginate =...

2 answers

0 votes

Asked by tnbrooks, on 17/1/10 in

Auth components password issue

When submitting a registration form I have the password field left blank. As this is required for the Auth component (have also set the email address as the username) it appears to be hashing the field value even if there is no value in it.

When...

1 answer

0 votes

Asked by Tyguy7, on 23/4/10 in

AutoComplete glitch

Sometimes AutoComplete pops up with a weird http:Controller missing class error, complete with my full outer layout, creating a very weird visual for about 1/10th of a second. Can anyone explain this? Is it common? Here's a video of the glitch...

1 answer

-1 votes

Asked by whoami, on 9/3/10 in

beforeFilter breaks redirect

If you have declared the beforeFilter method in one of your controllers and try to do a redirection using the controllers redirect method in some other method say index, you might get the following error:


Warning (2): Cannot modify header...
<< previous 1   2   3   4   5   6   7   8