2 answers
1 vote
$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
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
$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
$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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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...