Thursday, January 31, 2013

Re: Save ID for Associated Table

Also I forgot to mention I am getting this error message....SQL Error: 1452: Cannot add or update a child row: a foreign key constraint fails

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Save ID for Associated Table

I am trying to save the ID for a table called Coverages in a table called Spreadsheets. I have all my associations correct but for some reason I cannot wrap my head around this task, which I know it is probably simple. This is what I have tried. 

View:
<?php echo $this->UiForm->input('coverage.id', array('type' => 'hidden')); ?>

As you can see in my view I have created a hidden input field for my ID.

Controller:
public function processSpreadsheet($coverageId = null) {
if(!empty($this->data)) {
if(isset($this->data['Coverage']) && !empty($this->data['Coverage'])) {
if(array_key_exists('Spreadsheet', $this->data['Coverage']) && $this->data['Coverage']['Spreadsheet']['size'] > 0) {
$uploadedFile = $this->data['Coverage']['Spreadsheet'];
$coverageId = $this->Coverage->id;
$this->set('coverage.id', $coverageId);
$spreadsheetId = $this->Coverage->saveSpreadsheet($uploadedFile);
if($spreadsheetId) {
$this->Session->setFlash(__('Spreadsheet processed and saved successfully.', true));
$this->redirect(array(
'action' => 'edit',
$spreadsheetId
));
} else {
$this->Session->setFlash(__('Spreadsheet processing failed.', true));
$this->redirect(array(
'action' => 'add'
));
}
}
}
}
}
I have created a var called CoverageId in the controller also I have set the CoverageId as well.

Model:
public function saveSpreadsheet($uploadedFile) {
if(!empty($uploadedFile) && !empty($uploadedFile['tmp_name'])) {
if($uploadedFile['error'] == UPLOAD_ERR_OK) {
$pulledData = $this->extract($uploadedFile['tmp_name']);
$filePath = WWW_ROOT.'/spreadsheet/' . DS . $uploadedFile['name'] ;
if(!empty($pulledData)){
$pulledData = $this->Declination->ContactType->setSpreadsheetContactTypeIds($pulledData);
if(!empty($pulledData[$this->alias])) {
$this->save($pulledData[$this->alias]);
unset($pulledData[$this->alias]);
$coverageId = $this->id;
$pulledData = $this->setSpreadsheetCoverageIds($pulledData, $coverageId);
$pulledData = $this->CoverageInsured->setSpreadsheetCoverageInsuredIds($pulledData);
//$pulledData = $this->Policy->Location->setupSpreadsheetPolicyLocation($pulledData, $coverageId);
}
$this->CoverageInsured->save($pulledData['CoverageInsured']);
$this->Declination->saveAll($pulledData['Declination']);
$this->savePolicyData($pulledData);
$this->Spreadsheet->save($this->data);
move_uploaded_file($uploadedFile['tmp_name'], $filePath); 
//$this->Policy->Location->saveAll($pulledData['Location']);
//$this->Policy->Company->saveAll($pulledData['Policy']);
return $coverageId;
}
}
}
return false;
}

Last but not least I am saving data to my spreadsheet table.


Im not sure what Im doing wrong or what I am not doing at all. If someone would please explain to me how this is suppose to work. I have read the documentation but some things are still unclear to me. I think I am doing something wrong in my controller and my model. As far as my model goes I think its just a matter of passing the right argument to the save method, and Im not sure what Im doing wrong in my controller. With that said, any input on this issue will be greatly appreciated!! Thanks!!


     

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Change From AS in find request

Hi how could I change the AS ... in the finc request
FROM `fournitures`.`telephones_backup` AS `TelephoneBackup`

I would like the AS to be Telephone and no TelephoneBackup

$d['telephones'] = $this->TelephoneBackup->find('all',array(
                                                            'conditions'=>array('TelephoneBackup.id'=>$id

                                                                ),
                                                            'order'=> array('TelephoneBackup.modified ASC'),
        ));

Thanks

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

CakePHP ACL and paginate

Hi
I have these Model :
User (User belongsTo Group)
Group (Group hasMany User)
Document

I manage permissions to access to documents with ACL (User and Group like Aro and Document like Aco)

Now I have two questions :

1)How can I retrive all documents that a user can access and how can I paginate them?

2)How can I retrive all users that can access to a certainly document and how can I paginate them?

I would find best solutions about these questions (i.e. cn the lowest number of not heavy queries)

Many Thnaks

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Using CacheHelper to cache JSON views

I having the same exact issue with  2.2.4. Did you ever find a way to get this to work?

On Friday, July 27, 2012 10:58:10 AM UTC-4, Falagar wrote:

I cannot get this to work in 2.2. This is what I have tried:

First I just followed the book to create JSON views (http://book.cakephp.org/2.0/en/views/json-and-xml-views.html). Works great. I get JSON data back.

Then I followed the CacheHelper instructions (http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html). I un-commented Cache.check in core.php, added the CacheHelper in my Controller and defined $cacheAction. This works great for HTML Views. But, for JSON views nothing gets cached unfortunately.

I found this post: http://lars-schenk.com/cached-json-or-xml-view-with-cakephp/523 that ran into a similar issue (albeit in an earlier version of Cake that didn't have JsonView yet).

So I tried to use his method, and apply it to 2.2. I took Router::parseExtensions( 'json' ) out, took the RequestHandler out, created a json.ctp layout file.

  <!--nocache--><?php  configure::write('debug',0); // surpress all debug output on json views  header('Content-type: text/x-json');  ?><!--nocache--><?php echo $this->fetch('content'); ?>
 

a feed.ctp view file

  <?php echo json_encode( $data ); ?>
 

and changed my controller action to just set the layout and data

  $this->layout = 'json';  $this->view = 'feed';  $this->set( 'data', $data );
 

This works somewhat. I get the JSON file the first time, but when I request that action again, the response contains

  <!--nocache:001--><!--nocache:002-->
 

before the actual JSON data, so it won't work for my client app. I can see that chunk of text in the actual cache file as well, which I think is the problem.

So I am not quite sure how to proceed.

Am I just missing something painfully obvious?

Any help would be greatly appreciated.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

Since the files the errors refers to are in the cake directory, can I assume that cake 1.3 has strict standard errors coded into it, and my only choice for a remedy is to upgrade cake or explicitly remove strict stand error reporting?



On Thursday, January 31, 2013 4:55:48 AM UTC-5, euromark wrote:
since PHP5.4 E_STRICT is included in E_ALL (you would need to explicitly remove it).
That is why your PHP5.2 env does not report any strict errors (there you need to explicitly activate it).


Am Donnerstag, 31. Januar 2013 09:35:26 UTC+1 schrieb roundrightfarm:
So, I've discovered that setting short tags to "on" in ini.php has fixed another problem I was having, but I'm still getting the Strict Standards errors. The local server is running php 5.4, but my cake-app runs live on a server with 5.2 and without generating any Strict Standard errors.   Is it possible that the use of short tags in the code is causing these errors with 5.4?

On Wednesday, January 30, 2013 10:41:36 AM UTC-5, roundrightfarm wrote:
I have a completed app written in 1.3 that I'm trying to make changes
to

On Jan 29, 7:16 pm, benfarhat <benfarhat.el...@gmail.com> wrote:
> Try using the  latest version of Cake
> <https://github.com/cakephp/cakephp/zipball/2.3.0>  .
>
> --
> View this message in context:http://cakephp.1045679.n5.nabble.com/cakephp-on-XAMPP-for-windows-tp5...
> Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: get actions

Because of CakePHP does not use PHP namepscpaces a best practice is to prefix all your classes in a plugin with plugin name, if plugin name is customer change your class to CustomerAccountController or CustomerAccount model.

On Tuesday, January 29, 2013 11:51:04 AM UTC-2, Igor Padovan da Silva wrote:
Hi,

In this code, http://pastebin.com/9BUKfsGh , i need to get all actions from crontrollers. In my app i have the same controller in app and plugin, but when is executed $methods = get_class_methods($controller . 'Controller')it get the methods from controller tha is in app, it ignores de controller from plugin. I tried to use App::shutdown(), but it dosen't work.

Does anybody know what can I do?

Thanks,
Igor Padovan da Silva

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: CakeTestCase, output and graceful failing

Use --testdox-text in shell running, this allow to all tests to run with wich one is failing.

On Tuesday, January 29, 2013 4:28:32 PM UTC-2, Vanja Dizdarević wrote:
Pretty newb at Testing, but I wish to create a list-of-feature-test with some useful output.

I have created a test case for a parser which loads about a 100 input + expected pairs from an external definition file.

So far so good, test runs OK with this method:


    public function testFormats(){
        foreach ($this->tests as $case){
            $this->assertTextEquals(
                    $this->Parser->parse($case['input']), 
                    $case['expected'], 
                    $case['message']
                    );
        }
        
    }

But currently, I can only see if all test pass.

I have some features that are still being developed and I'm trying to push towards a test-driven-development pattern here.

This means I have many test I have made that are meant to fail, but I would like them to do so gracefully.

Is there a way a TestCase can output a list of all tests with "OK" or "FAILED" results, so other developers and end-users can see which of the features are safe to use?

Thanks!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Using variable from controller in model

Use $this->set('noslug', 1); instead.

On Tuesday, January 29, 2013 12:41:42 PM UTC-2, MetZ wrote:
Hi all.

I am struggling passing a variable to my before save function in my User model.

Controller:
$this->User->read(null, $data['user_id']);
                $this->User->set(array(
                    'noslug' => 1,
                    'TEST' => 'sdfsd'
                ));
        $this->User->save();

Model:

if(empty($this->data[$this->alias]['noslug']) {
  // noslug empty, do somthing cool
} else {
  // noslug not empty, do something else
}


$this->data[$this->alias]['noslug'] = always empty/false

How can I read the "noslug" = 1 in my model?

Thanks for any help on this!
-Tom

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Help / Source code for Simple Authentication tutorial

I'm having the exact same error message and can't seem to resolve it.
Did you ever find the solution? It sounds like you went through the same trouble.
 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Best IDE for CakePHP 2.1

I use Codelobster with special CakePHP plug-in. It works best for me.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

since PHP5.4 E_STRICT is included in E_ALL (you would need to explicitly remove it).
That is why your PHP5.2 env does not report any strict errors (there you need to explicitly activate it).


Am Donnerstag, 31. Januar 2013 09:35:26 UTC+1 schrieb roundrightfarm:
So, I've discovered that setting short tags to "on" in ini.php has fixed another problem I was having, but I'm still getting the Strict Standards errors. The local server is running php 5.4, but my cake-app runs live on a server with 5.2 and without generating any Strict Standard errors.   Is it possible that the use of short tags in the code is causing these errors with 5.4?

On Wednesday, January 30, 2013 10:41:36 AM UTC-5, roundrightfarm wrote:
I have a completed app written in 1.3 that I'm trying to make changes
to

On Jan 29, 7:16 pm, benfarhat <benfarhat.el...@gmail.com> wrote:
> Try using the  latest version of Cake
> <https://github.com/cakephp/cakephp/zipball/2.3.0>  .
>
> --
> View this message in context:http://cakephp.1045679.n5.nabble.com/cakephp-on-XAMPP-for-windows-tp5...
> Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

So, I've discovered that setting short tags to "on" in ini.php has fixed another problem I was having, but I'm still getting the Strict Standards errors. The local server is running php 5.4, but my cake-app runs live on a server with 5.2 and without generating any Strict Standard errors.   Is it possible that the use of short tags in the code is causing these errors with 5.4?

On Wednesday, January 30, 2013 10:41:36 AM UTC-5, roundrightfarm wrote:
I have a completed app written in 1.3 that I'm trying to make changes
to

On Jan 29, 7:16 pm, benfarhat <benfarhat.el...@gmail.com> wrote:
> Try using the  latest version of Cake
> <https://github.com/cakephp/cakephp/zipball/2.3.0>  .
>
> --
> View this message in context:http://cakephp.1045679.n5.nabble.com/cakephp-on-XAMPP-for-windows-tp5...
> Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Wednesday, January 30, 2013

Re: How to redirect two pages back?

Thanks, it works!.

El lunes, 16 de abril de 2012 10:19:23 UTC+2, euromark escribió:
@cricket
almost perfect - I would not pass the referer this way, though. creates overhead
and then I don't think the else case inside the post() is necessary.
after a post the same post data will populate the inputs anyway. therefore the Model.referer input should still have the same value.
no need to resend this variable to the view.
I also dont like to unnecessarily set defaults in the view.

echo $this->Form->input('Model.referer');

public function add() {

        if ($this->request->is('post')) {
                // validate ...
                
                if ($this->Model->save()) {
                        $referer = !empty($this->request->data['Model']['referer'])
                        ? $this->request->data['Model']['referer']
                        : '/';        // or some other fallback route of your choice
                        
                        $this->redirect($referer);
                }
        } else {
                $this->request->data['Model']['referer'] = $this->referer();
        }



you agree?


Am Montag, 16. April 2012 01:08:29 UTC+2 schrieb cricket:
On first display of the form pass the referer to the view to add it to the form.

echo $this->Form->input('Model.referer', array('value' => $referer));

public function add() {

        if ($this->request->is('post')) {
                
                $referer = isset($this->request->data['Model']['referer'])
                        ? $this->request->data['Model']['referer']
                        : '/';        // or some other fallback route of your choice
                        
                // validate ...
                
                if ($this->Model->save()) {
                
                        $this->redirect($referer);
                }
                else {
                        // flash msg, log, etc.
                        $this->set(compact('referer'));
                }
        }
        else {
                $this->set('referer', $this->referer());
        }
}


You have to use the else block to set the view var because if the save
failed it would overwrite it to the empty form. Likewise, you need to
create the $referer method var before attempting to save so that it's
available either way (to redirect or reset the view var).

On Sun, Apr 15, 2012 at 4:15 PM, Daniel <danw...@gmail.com> wrote:
> I am using the following code to go back a page, but the problem is
> that the action is an "add" one so it just goes back to an empty "add"
> form:
>
> if ($this->request->is('post')) {
>        // blah blah ...
>        if ($this->Inemail->save($this->request->data)) {
>                // blah blah ...
>                $this->redirect($this->referer());
>
> I think what I need to do is go back two pages.  Is this possible?
>
> Thanks.
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

I have a completed app written in 1.3 that I'm trying to make changes
to

On Jan 29, 7:16 pm, benfarhat <benfarhat.el...@gmail.com> wrote:
> Try using the  latest version of Cake
> <https://github.com/cakephp/cakephp/zipball/2.3.0>  .
>
> --
> View this message in context:http://cakephp.1045679.n5.nabble.com/cakephp-on-XAMPP-for-windows-tp5...
> Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Cache errors on Heroku with update to 2.3 but works fine on local?

Here's the thing - Heroku uses EC2, meaning that any files written are deleted on Git push. But I think you're right, so I'm gonna contact Heroku support the moment I get the chance. Thanks 

On Wednesday, January 30, 2013 7:51:12 AM UTC-5, Luciano Bargmann wrote:
First things first: I am almost sure you have a write permission problem. Have you tried to fix that?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

May I ask why did you pick cake 1.3? It seems that you want to explore CakePHP, so why not use the latest version?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: cakephp on XAMPP for windows

May I ask why did you pick cake 1.3? It seems that you want to explore CakePHP, so why not use the latest version?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Cache errors on Heroku with update to 2.3 but works fine on local?

First things first: I am almost sure you have a write permission problem. Have you tried to fix that?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Tuesday, January 29, 2013

Re: Issue with removing records (unset) from data array in afterFind

For future reference - this has been corrected in 2.2.6.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: autoComplete with jquery in cake 1.3

This is not a CakePHP issue. Most likely a javascript / CSS issue, I'd bet javascript.

On Tuesday, January 29, 2013 5:31:02 AM UTC-5, Chris wrote:
hi guys,.. can you help me please,... 
I'm in cake 1.3 and using jquery libraries 

I got all setup, including jquery.autocomplete.min.js from Ajax Javascript helper http://www.cakephp.4uk.pl/ajax/autoComplete ,... 
I can see the "fistnames" in autocomplete form field, but I can't select them,... 

how can I fix this...? 

this is my form: 

<?php echo $this->Form->create('User'); ?>

<div style="float: left; width: 200px; margin: 10px 0 40px 15px; ">
<?php echo $ajax->autoComplete('User.firstname', '/users/autoComplete', array('label' => false)); ?>
</div>

<span style="float: left; width: 200px; margin: 5px 0 40px 15px; ">
<?php echo $this->Form->end(__('Search', true)); ?>
</span> 


this is my function: 

function autoComplete() {

$this->set('members', $this->User->find('all', array(
'conditions' => array(
'User.firstname LIKE' => $this->params['url']['q'].'%'
),
'fields' => array('firstname')
)));
$this->layout = 'ajax';
}

and this is auto_complete.ctp file: 

<ul>
    <?php foreach($members as $member): ?>
     <li><?php echo $member['User']['firstname']; ?></li>

    <div class="clr"></div>
    <?php endforeach; ?>
</ul>

thanks in advance 
chris 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: autoComplete with jquery in cake 1.3

hi cricket,... thank you for your reply,... 
I did install Firebug,... and I don't see any errors,... 

is there a way I can contact you? What's you website or contact info,... 


On Tuesday, January 29, 2013 2:56:10 PM UTC-8, cricket wrote:
If you're seeing the results then it isn't a Cake problem. I'd guess
CSS, probably with the floats. Have you tried installing Firebug?

On Tue, Jan 29, 2013 at 5:31 AM, Chris <chri...@yahoo.com> wrote:
> hi guys,.. can you help me please,...
> I'm in cake 1.3 and using jquery libraries
>
> I got all setup, including jquery.autocomplete.min.js from Ajax Javascript
> helper http://www.cakephp.4uk.pl/ajax/autoComplete ,...
> I can see the "fistnames" in autocomplete form field, but I can't select
> them,...
>
> how can I fix this...?
>
> this is my form:
>
> <?php echo $this->Form->create('User'); ?>
>
> <div style="float: left; width: 200px; margin: 10px 0 40px 15px; ">
> <?php echo $ajax->autoComplete('User.firstname', '/users/autoComplete',
> array('label' => false)); ?>
> </div>
>
> <span style="float: left; width: 200px; margin: 5px 0 40px 15px; ">
> <?php echo $this->Form->end(__('Search', true)); ?>
> </span>
>
>
> this is my function:
>
> function autoComplete() {
>
> $this->set('members', $this->User->find('all', array(
> 'conditions' => array(
> 'User.firstname LIKE' => $this->params['url']['q'].'%'
> ),
> 'fields' => array('firstname')
> )));
> $this->layout = 'ajax';
> }
>
> and this is auto_complete.ctp file:
>
> <ul>
>     <?php foreach($members as $member): ?>
>      <li><?php echo $member['User']['firstname']; ?></li>
>
>     <div class="clr"></div>
>     <?php endforeach; ?>
> </ul>
>
> thanks in advance
> chris
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+u...@googlegroups.com.
> To post to this group, send email to cake...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Cache errors on Heroku with update to 2.3 but works fine on local?

I just updated my cake application to 2.3 and I started getting internal errors on my heroku application.

Warning (512): /app/www/app/tmp/cache/ is not writable [CORE/Cake/Cache/Engine/FileEngine.php, line 336]
Warning (2): file_put_contents(/app/www/app/tmp/logs/error.log) [http://php.net/function.file-put-contents]: failed to open stream: No such file or directory [CORE/Cake/Log/Engine/FileLog.php, line 88]

This works fine on my local server. Any tips?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: MongoDB queries being escaped?

Nvm got it.

$this->Course->find("all", array("conditions" => array("Course.professor" => array("\$regex" => ".*Odinga.*"))));

On Tuesday, January 29, 2013 8:56:00 PM UTC-5, Shahruk Khan wrote:
I am trying to do : $courses = $this->Course->find("all", array("conditions" => array("Course.professor" => "/Odinga/")));

This is the equivalent of Mysql %Odinga%. Unfortunately, I get the following query:

db.courses.find( {"professor":"\/\/Odinga, Sobukwe\/\/"} );

CakePHP is escaping the backslashes which are used in MongoDB for the LIKe query.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

MongoDB queries being escaped?

I am trying to do : $courses = $this->Course->find("all", array("conditions" => array("Course.professor" => "/Odinga/")));

This is the equivalent of Mysql %Odinga%. Unfortunately, I get the following query:

db.courses.find( {"professor":"\/\/Odinga, Sobukwe\/\/"} );

CakePHP is escaping the backslashes which are used in MongoDB for the LIKe query.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

I am running cake 1.3. Is it possible that there is something in 1.3
that is incompatible with XAMPP 1.8.1 and I need to upgrade cake (or
downgrade XAMPP)?

On Jan 29, 4:26 pm, roundrightfarm <roundrightf...@gmail.com> wrote:
> Greetings Everyone,
> Just installed XAMPP 1.8.1 for Windows which I plan to use to test a
> cakephp web-app.  The basic install worked fine, but once I copied all
> the cake files to htdocs, I started getting errors I don't
> understand.  Even with debug set to 0, I get this message:
>
> Strict Standards: Redefining already defined constructor for class
> Object in C:\xampp\htdocs\cake\libs\object.php on line 54
>
> Strict Standards: Non-static method Configure::getInstance() should
> not be called statically in C:\xampp\htdocs\cake\bootstrap.php on line
> 38
>
> Under this, my layout background eventually loads but the server can't
> find the content files.  With debug set to 2, I get a much longer list
> of Strict Standards errors.
>
> Does anybody understand these errors.  It my understanding that I
> shouldn't alter files in the cake folder, so I'm assuming the problem
> must lie elsewhere in my setup and not in the files mentioned by the
> errors.
>
> Thanks for your help!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Validating multiple fields problem

CharactersEvent would have just been the join table in a HABTM relationship between the Character model and the Event model if it wasnt for the fact that I needed to also assign a role to that record. Thus, it got promoted into needing its own Model and now is part of a HasMany/Belongs to with the Character, Event and Role models. Since this record is being created when I save the Event form, all the request data is stored in $this->Event->data which is what I am checking to make sure the user didn't add the same character twice or if the event even allows that many characters to be assigned to it. Basic validation stuff except for the fact that I am validating against data that is apparently stored in another model.

When I put a debug statement before the validation, all the data is there as I would expect, but.. the strange thing is, it prints twice. The second time, the data is no longer in $this->Event->data as it seems to have been cleared which then makes my for loop fail. I have no idea why it gets called a 2nd time as it returned true to the validation rule (debug confirmed this) the first time. I thought it might have had something to do with the fact that I had 2 different fields for the same kind of role (this is ok, the event type allows for multiple roles to be assigned to this event) but when I changed the code to have 3 fields instead of just 2, it still only ran twice, again failing the 2nd time. Is there maybe a way I can save the data to a session then use that? It seems really hacky but I'm not sure why cake is working the way it is. Thanks for the help.

~Michael


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: cakephp on XAMPP for windows

Try using the latest version of Cake
<https://github.com/cakephp/cakephp/zipball/2.3.0> .



--
View this message in context: http://cakephp.1045679.n5.nabble.com/cakephp-on-XAMPP-for-windows-tp5713475p5713479.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Using variable from controller in model

Are you sure that User->data exists after calling read()?

After calling set() debug the User->data to see whether id is set.

On Tue, Jan 29, 2013 at 9:41 AM, MetZ <metz80@gmail.com> wrote:
> Hi all.
>
> I am struggling passing a variable to my before save function in my User
> model.
>
> Controller:
> $this->User->read(null, $data['user_id']);
> $this->User->set(array(
> 'noslug' => 1,
> 'TEST' => 'sdfsd'
> ));
> $this->User->save();
>
> Model:
>
> if(empty($this->data[$this->alias]['noslug']) {
> // noslug empty, do somthing cool
> } else {
> // noslug not empty, do something else
> }
>
>
> $this->data[$this->alias]['noslug'] = always empty/false
>
> How can I read the "noslug" = 1 in my model?
>
> Thanks for any help on this!
> -Tom
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: autoComplete with jquery in cake 1.3

If you're seeing the results then it isn't a Cake problem. I'd guess
CSS, probably with the floats. Have you tried installing Firebug?

On Tue, Jan 29, 2013 at 5:31 AM, Chris <chris69m@yahoo.com> wrote:
> hi guys,.. can you help me please,...
> I'm in cake 1.3 and using jquery libraries
>
> I got all setup, including jquery.autocomplete.min.js from Ajax Javascript
> helper http://www.cakephp.4uk.pl/ajax/autoComplete ,...
> I can see the "fistnames" in autocomplete form field, but I can't select
> them,...
>
> how can I fix this...?
>
> this is my form:
>
> <?php echo $this->Form->create('User'); ?>
>
> <div style="float: left; width: 200px; margin: 10px 0 40px 15px; ">
> <?php echo $ajax->autoComplete('User.firstname', '/users/autoComplete',
> array('label' => false)); ?>
> </div>
>
> <span style="float: left; width: 200px; margin: 5px 0 40px 15px; ">
> <?php echo $this->Form->end(__('Search', true)); ?>
> </span>
>
>
> this is my function:
>
> function autoComplete() {
>
> $this->set('members', $this->User->find('all', array(
> 'conditions' => array(
> 'User.firstname LIKE' => $this->params['url']['q'].'%'
> ),
> 'fields' => array('firstname')
> )));
> $this->layout = 'ajax';
> }
>
> and this is auto_complete.ctp file:
>
> <ul>
> <?php foreach($members as $member): ?>
> <li><?php echo $member['User']['firstname']; ?></li>
>
> <div class="clr"></div>
> <?php endforeach; ?>
> </ul>
>
> thanks in advance
> chris
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Validating multiple fields problem

That's kind of a lot to take in. I'm not sure what to make of your
models. CharactersEvent, especially.

You don't say how you're saving the data, btw. And have you tried
putting a log call just before the foreach?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

cakephp on XAMPP for windows

Greetings Everyone,
Just installed XAMPP 1.8.1 for Windows which I plan to use to test a
cakephp web-app. The basic install worked fine, but once I copied all
the cake files to htdocs, I started getting errors I don't
understand. Even with debug set to 0, I get this message:

Strict Standards: Redefining already defined constructor for class
Object in C:\xampp\htdocs\cake\libs\object.php on line 54

Strict Standards: Non-static method Configure::getInstance() should
not be called statically in C:\xampp\htdocs\cake\bootstrap.php on line
38

Under this, my layout background eventually loads but the server can't
find the content files. With debug set to 2, I get a much longer list
of Strict Standards errors.

Does anybody understand these errors. It my understanding that I
shouldn't alter files in the cake folder, so I'm assuming the problem
must lie elsewhere in my setup and not in the files mentioned by the
errors.

Thanks for your help!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Auth Login Redirect is not redirecting or encrypting user info

I'm using cakephp 2.3, and trying to use a table other than users(editors)
for user authentication. Using topics here, stackoverflow and the
documentation for reference, i've almost got it, just hung up on the login.
If I try to access anything, the app does display the login, however even
with correct credentials, it looks like it loads but doesn't move past the
login view. No error is displayed. And for some reason, any user(Editor in
my case) doesn't have an encrypted password in the DB. I've been at this for
a day and a half and don't know what to do at this point. The table fields
are the standard user fields just in a table named editors. and the login
view is standard. The code for the login/logout I used from the
documenation. Any suggestions? I would use Users, but another Cake 1.3 app
is using that table and i'm not sure how difficult it would be to use the
same table.(I tried but the user passwords weren't encrypted there
either..so it might be how i'm using auth?

References:

1.
http://stackoverflow.com/questions/9929129/cakephp-authentication-component-using-a-different-table-name-and-column-name

2.
http://stackoverflow.com/questions/6016044/cakephp-autentication-with-auth-table-other-than-user-problem

3. http://stackoverflow.com/questions/7258455/cakephp-login-redirect-problem

4.
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#configuring-authentication-handlers

5.
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in


AppController:

class AppController extends Controller {
public $components = array(
'Session',
'Security',
'Auth'=> array(
'loginAction' => array(
'controller' => 'editors',
'action' => 'login',
),
'authorize' => array('Controller'),
'authError' => 'You are not authorized to access that page.',
'authenticate' => array(
'Form'
)
)
);
//public $helpers = array('Form','Html','Session');

public function isAuthorized($user) {
return true;
}

public function beforeFilter() {
//$this->Auth->authenticate = ClassRegistry::init('Editor');
$this->Auth->loginAction =
array('controller'=>'editors','action'=>'login');
$this->Auth->loginRedirect =
array('controller'=>'drugs','action'=>'index');
$this->Auth->loginError = 'Incorrect Username/Password
Combination.';
$this->Auth->logoutRedirect =
array('controller'=>'editors','action'=>'login');
//$this->set('logged_in', $this->Auth->loggedIn());
//$this->set('current_user', $this->Auth->user());
}
}

Editors Controller:

public function beforeFilter() {
parent::beforeFilter();
//$this->Auth->allow('add');
//$this->Auth->autoRedirect = false;
}

public function beforeSave($options = array()) {
if (isset($this->data['Editor']['password'])) {
$this->data['Editor']['password'] =
AuthComponent::password($this->data['Editor']['password']);
}
return true;
}
public function login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
return $this->redirect($this->Auth->redirectUrl());
//return $this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Username or password is
incorrect'), 'default', array(), 'auth');
}
}
}

public function logout() {
$this->redirect($this->Auth->logout());
}

Model:

<?php
App::uses('AppModel', 'Model');
/**
* Editor Model
*
*/
class Editor extends AppModel {

public $displayField = 'name';
}



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Auth-Login-Redirect-is-not-redirecting-or-encrypting-user-info-tp5713474.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

CakeTestCase, output and graceful failing

Pretty newb at Testing, but I wish to create a list-of-feature-test with some useful output.

I have created a test case for a parser which loads about a 100 input + expected pairs from an external definition file.

So far so good, test runs OK with this method:


    public function testFormats(){
        foreach ($this->tests as $case){
            $this->assertTextEquals(
                    $this->Parser->parse($case['input']), 
                    $case['expected'], 
                    $case['message']
                    );
        }
        
    }

But currently, I can only see if all test pass.

I have some features that are still being developed and I'm trying to push towards a test-driven-development pattern here.

This means I have many test I have made that are meant to fail, but I would like them to do so gracefully.

Is there a way a TestCase can output a list of all tests with "OK" or "FAILED" results, so other developers and end-users can see which of the features are safe to use?

Thanks!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

a few questions about Cake Bake and latest version 2.30

Hi newbie here to CakePHP!

I've got my project setup via Bake, and the database configuration, but i'm a bit stuck I've read somewhere about using the -admin flags within Bake.

Not sure if I've read it right but is it my understanding if you use the -admin flag some how (not worked that part out) it should produce the following: 

View | Articles
  • admin_add.ctp
  • admin_edit.ctp
  • admin_index.ctp
  • admin_view.ctp
Instead of the following:

View | Articles
  • add.ctp
  • edit.ctp
  • index.ctp
  • view.ctp
If this is correct can someone tell me exactly how I need to do it via cake bake all

Also on http://www.cakephp.org is somewhat out of date with the TV section after reading some of the stuff on there quite a bit has changed since version 1.3 
updating this might resolve a few newbies headaches.....

The site also claims that version 2.30 has been released but on git it only shows 2.30 Beta??? is this a typo on the site or is it been released or still in Beta??

Thanks in advance.

Regards

Mal

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Using variable from controller in model

Hi all.

I am struggling passing a variable to my before save function in my User model.

Controller:
$this->User->read(null, $data['user_id']);
                $this->User->set(array(
                    'noslug' => 1,
                    'TEST' => 'sdfsd'
                ));
        $this->User->save();

Model:

if(empty($this->data[$this->alias]['noslug']) {
  // noslug empty, do somthing cool
} else {
  // noslug not empty, do something else
}


$this->data[$this->alias]['noslug'] = always empty/false

How can I read the "noslug" = 1 in my model?

Thanks for any help on this!
-Tom

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

get actions

Hi,

In this code, http://pastebin.com/9BUKfsGh , i need to get all actions from crontrollers. In my app i have the same controller in app and plugin, but when is executed $methods = get_class_methods($controller . 'Controller')it get the methods from controller tha is in app, it ignores de controller from plugin. I tried to use App::shutdown(), but it dosen't work.

Does anybody know what can I do?

Thanks,
Igor Padovan da Silva

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.