Re: How to send variable to the custom script and run without redirect

2012-01-18 Thread jeremyharris
Maybe don't send the response until you're ready... Check out the api 
here: http://api20.cakephp.org/class/cake-response

Calling send() actually sends the header, whereas header() just keeps them 
buffered until you're ready to send the response.

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cakeDC utils csvImport - extra record

2012-01-18 Thread elogic
This is what I originally thought but I tested it with a csv file that
I first opened in notepad to make sure there wasn't the extra line in
there. It still generates the extra record.

Any ideas?

Thanks

On Jan 19, 12:35 pm, José Lorenzo  wrote:
> probably an extra line in your CSV file

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: sorting

2012-01-18 Thread Briko03
I resolved this myself:

function sundown($season,$race,$sex,$class,$team)
{
if ($season ==null){$conditions = array('Result.location' =>
'Sundown');}
else if ($race ==null) {$conditions = array('Result.location' =>
'Sundown','Result.season'=>$season);}
else if ($sex ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race);}
else if ($class ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race,'Result.sex'=>$sex);}
else if ($team ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race,'Result.sex'=>$sex,'Result.class'=>$class);}
else {$conditions = array('Result.location'=>'Sundown',
'Result.season'=>$season, 'Result.racenum'=>$race,'Result.sex'=>
$sex,'Result.class'=>$class,'Result.team'=>$team);}

$params = array(
'conditions' => $conditions,
'order' => array('Result.racenum', 'Result.bib ASC'),
   );

$this->set('results',$this->Result->find('all',$params));


}

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


sorting

2012-01-18 Thread Briko03
I am trying to sort my results by Result.racenum and Result.class
however I've been away from php for a while and I was never very good
to begin with.

I have a function:

function sundown($season,$race,$sex,$class,$team)
{
if ($season ==null){$conditions = array('Result.location' =>
'Sundown');}
else if ($race ==null) {$conditions = array('Result.location' =>
'Sundown','Result.season'=>$season);}
else if ($sex ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race);}
else if ($class ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race,'Result.sex'=>$sex);}
else if ($team ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race,'Result.sex'=>$sex,'Result.class'=>$class);}
else {$conditions = array('Result.location'=>'Sundown',
'Result.season'=>$season, 'Result.racenum'=>$race,'Result.sex'=>
$sex,'Result.class'=>$class,'Result.team'=>$team);}

$this->set('results',$this->Result->find('all',array('conditions' =>
$conditions)));
}

I tried adding this  however no luck..
//$order = array('Result.racenum', 'Result.class ASC');
//$this->set('results',$this->Result->find('all',array('conditions' =>
$conditions),array('order' => $order)));

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How to send variable to the custom script and run without redirect

2012-01-18 Thread kani
Controller {

Action {
 ...
 $this->response->header('Location', 'http://domain/custom.php?url='.
$url);
 $this->response->send();

 // Problem is response redirecting before run below codes.  /
 ...
if ($this->Book->save($this->request->data)) {
$this->Session->setFlash(__('The book has been
saved'));
$this->redirect(array('action' => 'index'));
 ...
 }
}

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Starting with 1.13 or 2.0

2012-01-18 Thread José Lorenzo
2.0, no doubt!

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cakeDC utils csvImport - extra record

2012-01-18 Thread José Lorenzo
probably an extra line in your CSV file

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Custom Find Type & Pagination Problem - CakePHP 2.0.5

2012-01-18 Thread José Lorenzo
Check this out, this will solve your problem:

https://github.com/cakephp/CakeFest-2010-Workshop/blob/master/models/event.php#L88

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: java script detection at the time of site load

2012-01-18 Thread Miles J
You can't detect if JS is enabled via PHP.

On Jan 18, 7:28 am, bujanga  wrote:
> https://www.google.com/search?q=javascript+version+check
>
> On Wed, Jan 18, 2012 at 6:52 AM, vaibhav pathak
>
>
>
>
>
>
>
>  wrote:
> > Please any one can tell me how i can detect that java script of
> > browser is on or not in cake cake php?
>
> > Thanks
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems with URL

2012-01-18 Thread Florin Trifu
Hi Thad

I will answer to your question without knowing the error you receive, so it
might not be the solution to your problem.
The link you provided in your mail, shows that you don't use the correct
name for your controller. You should name your controller with the plural
of the world you use.
In consequence, you should do the following changes:

- rename the controller file to "PaymentsController.php"
- rename the class defined in the controller to class PaymentsController

As a good practice, please also send in the future the error you receive.

Best regards

On Wed, Jan 18, 2012 at 3:23 PM, Thad  wrote:

> Hey guys,
>
> i'm trying to workout in an app code here but i'm getting the message:
> URL should be set in array format (i.e., array('controller' =>
> 'controller', 'action' => 'action') for other than "/". Fix your
> helper usage.
>
> Everything seems to be ok and I don't know what to do anymore. The URL
> is like:
>
> http://website.com/payment/express/160 where payment = controller,
> express = action and 160 = params.
>
> Do you have any idea of what i can do?
>
> --
> 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+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Unable to save using model->save()

2012-01-18 Thread 24hours
Just noticed how foolish Im, the problem is:
create( $model = NULL, $options = array ( ) )
first field should be model and i used create('Post') on Art model of
course it won't work !
I thought the first field is form method without consulting the API
page.
Thanks for your help and the DebugKit rock

On Jan 17, 11:05 pm, jeremyharris  wrote:
> DebugKit will show 0 queries if you have the sql element somewhere else,
> since it clears the logs. If you're in debug mode then there will
> definitely be at least a few queries each request because it doesn't cache
> (rather, very shortly) the table schemas. Make sure you're not echoing the
> sql log somewhere else.

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: java script detection at the time of site load

2012-01-18 Thread bujanga
https://www.google.com/search?q=javascript+version+check


On Wed, Jan 18, 2012 at 6:52 AM, vaibhav pathak
 wrote:
> Please any one can tell me how i can detect that java script of
> browser is on or not in cake cake php?
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how to count downloads

2012-01-18 Thread euromark
a pretty similar question has just been asked a day before you posted
this on ask.cakephp.org @ stackoverflow:
http://stackoverflow.com/questions/8877842/how-to-count-the-number-of-user-downloads/
with probably the answer you are looking for


On 18 Jan., 15:37, ahmed fakher  wrote:
> i want to know how to count when someone click to download some
> file..please i need one example with answer ..cause i mam newbie
>
> important notice
> .. i don't store my files in database..i store it into webroot/files
> and i use meioupload to upload files
> i see this tut but i don't understand how to use it
>
> CREATE TABLE IF NOT EXISTS `downloads` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `filename` varchar(50) NOT NULL,
>   `title` varchar(70) NOT NULL,
>   `type` varchar(150) NOT NULL,
>   `filesize` int(11) unsigned NOT NULL,
>   `counts` int(11) NOT NULL,
>   `created` datetime NOT NULL,
>   PRIMARY KEY (`id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
>
> {{{
>
> downloads_controller.php
>
>  class DownloadsController extends AppController {
>      var $helpers = array ( "Html", "Ajax", "Javascript" ,"Number");
>      var $name = 'Downloads';
>      var $paginate = array('limit' => 3, 'page' => 1, 'order' =>
>                                 array('Download.id'=>'desc'));
>
>     function index() {
>         $this->set('downloads', $this->paginate());
>     }}
>
> ?>
>
> downloads/index.ctp
>
>      $i = 0;
>     foreach ($downloads as $download):
>         $class = null;
>         if ($i++ % 2 == 0) {
>             $class = ' class="altrow"';
>         }
>     ?>
>     >
>         
>
>    $title = $download['Download']['title'];
> $filename = '/files/'.$download['Download']['filename'];
>  echo $this->Html->link($title, $filename,array('escape' => false));
>
> ?>
>
> 

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake bake command giving error in ubuntu 11.10

2012-01-18 Thread Sam Sherlock
You have a comment in the conf file mentioned, that uses # which is
depreciated.

You have an old version of cake installed, via apt get. You should remove
it and install either 1.3 or 2.0

- S
On 18 Jan 2012 09:06, "adarsh snehajan"  wrote:

> hi,
>
> When I giving bake command in  ubuntu i am getting the following error
>
>
> PHP Deprecated:  Comments starting with '#' are deprecated in /etc/
> php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
>
> Welcome to CakePHP v1.2.4.8284 Console
> ---
> App : app
> Path: /var/www/tiacha/app
> ---
> Interactive Bake Shell
> ---
> [D]atabase Configuration
> [M]odel
> [V]iew
> [C]ontroller
> [P]roject
> [Q]uit
> PHP Fatal error:  Call to undefined method App::path() in /var/www/
> tiacha/cake/libs/i18n.php on line 267
>
> Fatal error: Call to undefined method App::path() in /var/www/tiacha/
> cake/libs/i18n.php on line 267
>
>
>
> Is anything wrong with my command plz help!!!
>
>
>
> Adarsh.
>
> --
> 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+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


how to count downloads

2012-01-18 Thread ahmed fakher
i want to know how to count when someone click to download some
file..please i need one example with answer ..cause i mam newbie

important notice
.. i don't store my files in database..i store it into webroot/files
and i use meioupload to upload files
i see this tut but i don't understand how to use it



CREATE TABLE IF NOT EXISTS `downloads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filename` varchar(50) NOT NULL,
  `title` varchar(70) NOT NULL,
  `type` varchar(150) NOT NULL,
  `filesize` int(11) unsigned NOT NULL,
  `counts` int(11) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;


{{{

downloads_controller.php


 3, 'page' => 1, 'order' =>
array('Download.id'=>'desc'));

function index() {
$this->set('downloads', $this->paginate());
}
}
?>

downloads/index.ctp



>


 Html->link($title, $filename,array('escape' => false));

?>



-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with TinyMCE

2012-01-18 Thread Sam Sherlock
I thought that shorttags could be ini_set.

Perhaps in bootstrap.php

- S
On 17 Jan 2012 11:45, "LipeDjow"  wrote:

> Hi AD7six,
>
> I have the same problem, using CakePHP and TinyMCE Plugin.
>
> I saw here (
> http://groups.google.com/group/cake-php/browse_thread/thread/e0b7196b7c00288/578c9d67a6b9525f?lnk=gst&q=tinymce#578c9d67a6b9525f)
>  that
> it is a short_open_tag issue.. but one guy in another thread (
> http://cakephp.1045679.n5.nabble.com/CakePHP-2-0-0-RC2-and-TinyMCE-3-4-4-td4831191.html)
> did a code change and it worked (didn't test).
>
> What do you think about this change? I'm afraid I can't set short_open_tag
> to false.
>
> Thanks!
> LipeDjow
>
>  --
> 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+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


how to count downloads

2012-01-18 Thread ahmed fakher
i want to know how to count when someone click to download some file..

important notice.. i don't store my files in database..i store it into
webroot/files

and i use meioupload to upload files


CREATE TABLE IF NOT EXISTS `downloads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filename` varchar(50) NOT NULL,
  `title` varchar(70) NOT NULL,
  `type` varchar(150) NOT NULL,
  `filesize` int(11) unsigned NOT NULL,
  `counts` int(11) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;


{{{

downloads_controller.php


 3, 'page' => 1, 'order' =>
array('Download.id'=>'desc'));

function index() {
$this->set('downloads', $this->paginate());
}
}
?>

downloads/index.ctp



>


 Html->link($title, $filename,array('escape' => false));

?>



-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problems with URL

2012-01-18 Thread Thad
Hey guys,

i'm trying to workout in an app code here but i'm getting the message:
URL should be set in array format (i.e., array('controller' =>
'controller', 'action' => 'action') for other than "/". Fix your
helper usage.

Everything seems to be ok and I don't know what to do anymore. The URL
is like:

http://website.com/payment/express/160 where payment = controller,
express = action and 160 = params.

Do you have any idea of what i can do?

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with pagination 2.1.0

2012-01-18 Thread Marin Marušić
I tried changing the variable name to $new as $news... I'll try your
method, but...

The error comes as Undefined index on $this->Paginate->numbers ... i
do get the data. Limit works, and ordering.

On Jan 17, 9:02 pm, Tilen Majerle  wrote:
> check your view file
>
> 
> it should be
> 
> second variable name should not be the same as array you are going through
>
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2012/1/17 Marin Marušić 
>
>
>
>
>
>
>
> > Hi,
>
> > I'm having a problem with pagination from an external controller.
>
> > So I have a view in PagesController that should get paginated content
> > from NewsController, and this works. I get paginated content, but when
> > I do $this->Paginate->numbers();
>
> > I need numbers to show, because I need to automate them to turn over
> > each page every six seconds.
> > Even that the view puts every $news in a separately marked layer would
> > do, as I could then select it via jQuery and paginate with it.
>
> > Or is it something simple as not using PagesController, i'm only using
> > it because content is basically static, with only a few db fetches.
> > And if so, it wouldn't work for getting data anyway, or would it.
>
> > Please, can anybody help?
>
> > Thanks in advance :)
>
> > Code below :)
>
> > class NewsController extends AppController {
>
> >  public $helpers = array('Html', 'Session','Js' =>
> > array('Jquery'),'Paginator');
> >        var $paginate = array(
> >                'limit' => 1,
> >                'pages'=>3,
> >                'order' => array(
> >                'News.create_date' => 'desc'
> >                )
> >        );
> >        public function index() {
> >                $this->layout='admin';
> >                $this->News->recursive = 1;
> >                $news = $this->paginate();
> >        if ($this->request->is('requested')) {
> >            return $news;
> >        } else {
> >            $this->set('news', $news);
> >        }
> >        }
> > ===
>
> > /View/Pages/home.ctp
>
> > 
> >        
> >                Novosti
> >                
> >                 > height="199">
>
> >                
> > requestAction('news/index/paginate:create_date/
> > desc:limit/1');?>
>
> >                
>
> >                
> >                
> >                                Pročitaj više...
> >                
> >                
> >                Paginate->numbers();?>
> >                
>
> >        
>
> > =
>
> > 
> > App::uses('AppController', 'Controller');
>
> > class PagesController extends AppController {
>
> >        public $name = 'Pages';
>
> >        public $helpers = array('Html', 'Session','Js' =>
> > array('Jquery'),'Paginator');
> >        var $paginate = array('limit' => 3, 'page' => 1);
> >        public $uses = array('News','Blocks');
>
> >        public function display() {
> >                $path = func_get_args();
> >                $count = count($path);
> >                if (!$count) {
> >                        $this->redirect('/');
> >                }
> >                $page = $subpage = $title_for_layout = null;
>
> >                if (!empty($path[0])) {
> >                        $page = $path[0];
> >                }
> >                if (!empty($path[1])) {
> >                        $subpage = $path[1];
> >                }
> >                if (!empty($path[$count - 1])) {
> >                        $title_for_layout =
> > Inflector::humanize($path[$count - 1]);
> >                }
> >                $this->set(compact('page', 'subpage', 'title_for_layout'));
> >                $this->render(implode('/', $path));
> >        }
>
> > }
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


java script detection at the time of site load

2012-01-18 Thread vaibhav pathak
Please any one can tell me how i can detect that java script of
browser is on or not in cake cake php?

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Missing GROUP BY in query SELECT Max(Alias.field1) as field1, field2 From table

2012-01-18 Thread AD7six


On Jan 17, 7:54 pm, quentin  wrote:
> Hi AD7six
>
> Thanks for your answer.
>
> Yes I've realized my mistake.
> Off course it's a sql error and I was wrong when I though that this could
> come from the treeBehavior because as you said : "The tree behavior does
> not mix max() with other fields" and the other field come from another
> behavior that add fields.
>
> Again thanks you for your answer event if it's not a really interesting
> error ^^.
>
> last thing : I don't understand TreeBehavior isn't appropriate because
> menus can have many levels and I often read children's node. Do you use a
> simpler implementation?

In reality it will make little difference either way - except that the
tree behavior adds some complexity to development if it's not working
correctly as was the case for you.

However - unless your menu is incredibly complex (which would cause UI
problems) there simply isn't enough data for using the tree behavior
to make sense. IMO. To clarify what I meant: it is likely to be more
efficient to do:

select * from menus where section = "main";

and pass the results into a nesting function which extracts the
subtree you want, than to do sub-tree queries on the menu - simply
because it's the same query always - the same cache hit no matter
which part of the menu you are rendering.

See this test case which demonstrates what I mean, and is something
I'll likely add to 2.1

https://github.com/AD7six/cakephp/blob/feature/set-nest/lib/Cake/Test/Case/Utility/SetTest.php#L3289

Unless there are other reasons to use the tree behavior - I wouldn't
choose to use it personally for menu data.

Also possibly worth pointing out this test, which demonstrates how I
convert flat data into nested uls with a menu helper:

https://github.com/AD7six/mi/blob/master/tests/cases/helpers/menu.test.php#L150

Note the use of the "under" key.

In any event, glad you found the cause for the wonky sql.

AD

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Read configuration variables from the controller, CakePHP V2

2012-01-18 Thread Abraham Boray
Okay, Thank YOU :)..It's workin'!


-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Trouble Linking Models

2012-01-18 Thread Clint
Thanks Jeremy I'll look into that.

I wasn't sure if how the other models had relationships setup if they were 
taken into consideration or if it was just the one you were using.


> You set those associations up in their respective models. So, for example, in 
> your Record model, Record hasOne Image. You can then do a find from the Band 
> model that will bring in Records and Images. I'd recommend looking up the 
> Containable behaviour as that will make finds really easy.
> 
> Jeremy Burns
> Class Outfit
> 
> http://www.classoutfit.com
> 
> On 18 Jan 2012, at 11:54:46, Clint wrote:
> 
>> I'm trying to link a few models together, but I'm having difficulty in 
>> linking the second level of model in.
>> 
>> For example, say I have a Band which has many Members, many Gigs and many 
>> Records. This can be easily represented in the Band model as:
>> 
>> var $hasMany = array('Members', 'Gigs', 'Records');
>> 
>> Everything links fine given the correct field names, but then how do I link 
>> another model to Members, Gigs, or Records? Say each Record has one cover 
>> Image.. I'm not sure how to define / represent it.
>> 
>> Thanks!
>> 
>> Clint
>> 
>> -- 
>> 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+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Trouble Linking Models

2012-01-18 Thread Jeremy Burns | Class Outfit
You set those associations up in their respective models. So, for example, in 
your Record model, Record hasOne Image. You can then do a find from the Band 
model that will bring in Records and Images. I'd recommend looking up the 
Containable behaviour as that will make finds really easy.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 18 Jan 2012, at 11:54:46, Clint wrote:

> I'm trying to link a few models together, but I'm having difficulty in 
> linking the second level of model in.
> 
> For example, say I have a Band which has many Members, many Gigs and many 
> Records. This can be easily represented in the Band model as:
> 
> var $hasMany = array('Members', 'Gigs', 'Records');
> 
> Everything links fine given the correct field names, but then how do I link 
> another model to Members, Gigs, or Records? Say each Record has one cover 
> Image.. I'm not sure how to define / represent it.
> 
> Thanks!
> 
> Clint
> 
> -- 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Trouble Linking Models

2012-01-18 Thread Clint
I'm trying to link a few models together, but I'm having difficulty in linking 
the second level of model in.

For example, say I have a Band which has many Members, many Gigs and many 
Records. This can be easily represented in the Band model as:

var $hasMany = array('Members', 'Gigs', 'Records');

Everything links fine given the correct field names, but then how do I link 
another model to Members, Gigs, or Records? Say each Record has one cover 
Image.. I'm not sure how to define / represent it.

Thanks!

Clint

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Read configuration variables from the controller, CakePHP V2

2012-01-18 Thread Tilen Majerle
You cannot functions while declaring propertiesso create constructor
and there set value from method/function...
Dne sreda, 18. januar 2012 je pošiljatelj Abraham Boray <
abrahambo...@gmail.com> napisal:
> I'm trying to read some of the variable I put in the configuration file
Core.php.
> So I can have like class Variables that takes their values from the core
Variable.
> EG
>class QuestionsController extends AppController {
>var $visite_status = Configure::read('visite_status');
> }
> But this isn't working in the controller, any ideas how can I do this ?
> Thank you in advance.
>
> --
> 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+unsubscr...@googlegroups.com For more options, visit this group
at http://groups.google.com/group/cake-php
>

-- 
--
Lep pozdrav, Tilen Majerle
http://majerle.eu

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Read configuration variables from the controller, CakePHP V2

2012-01-18 Thread Abraham Boray
I'm trying to read some of the variable I put in the configuration file 
Core.php.
So I can have like class Variables that takes their values from the core 
Variable.

EG

   class QuestionsController extends AppController {
   var $visite_status = Configure::read('visite_status');

}
But this isn't working in the controller, any ideas how can I do this ?

Thank you in advance. 

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


help for a newb - internal error has occured?

2012-01-18 Thread cyboman
I'm trying to get a cakePHP site up and running in a new host
environment. Everything is working except I get this mysterious error
when entering the CMS portion of the site, it is also caused upon
using the search feature.  I did a small hack I found on the web to
show more details on the error and traced the parameters out.  This is
what I get on both bugs for the params of the error: "Array
( [className] => SearchIndex [table] => search_index [code] => 500 )"
I've been looking around but I'm at a loss here. I am by no means a
PHP expert and I'm definitely a cakePHP newb.  I'm trying to get
caught up enough just to make some small changes to the site and at
least get it up and running.  Any help much appreciated!

Cheers,

-cyboman

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cake bake command giving error in ubuntu 11.10

2012-01-18 Thread adarsh snehajan
hi,

When I giving bake command in  ubuntu i am getting the following error


PHP Deprecated:  Comments starting with '#' are deprecated in /etc/
php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0

Welcome to CakePHP v1.2.4.8284 Console
---
App : app
Path: /var/www/tiacha/app
---
Interactive Bake Shell
---
[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[Q]uit
PHP Fatal error:  Call to undefined method App::path() in /var/www/
tiacha/cake/libs/i18n.php on line 267

Fatal error: Call to undefined method App::path() in /var/www/tiacha/
cake/libs/i18n.php on line 267



Is anything wrong with my command plz help!!!



Adarsh.

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: AuthComponent using Cookies

2012-01-18 Thread Angad Nadkarni
Thanks 100rk, you pretty much answered all I needed to know.
Just realized that the Cookie overhead per request is just not
worth it. Best use Sessions and scale them across multiple servers
appropriately when the need arises.

Your suggested solutions to getting it to use Cookies instead of
Sessions
were far more elegant than mine too, thanks! But for now I think I'll
run it
the Cake way and stick to Sessions.

On Jan 18, 4:30 am, 100rk  wrote:
> Generally, cookies are not designed to be overused (many cookies or
> large datasets stored in them), they are being sent to the server
> along with every request.
>
> If you _really_ want to substitute SessionComponent in whole
> application with CookieComponent, try to remap used class:
>
> class AppController extends Controller {
>     public $components = array(
>         'Session' => array('className' => 'Cookie'),
>         'Auth' => array(
> ...
>
> - their read/write/delete api is the same, so it _could_ work, as a
> workaround, maybe (IDK for sure).

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php