add 2 records in i18n for a new record

2012-07-04 Thread marcogo
hi
i want to add a multiple lines (ita & eng) in i18n for one record in jewel
so i add a afterSave in model
cause i want to add multiple lines only for a new record and not for a 
modify one

i add this

public function afterSave($created) {
if ($created) {
  if (isset ($this->data['Jewel']['eng'])) {
$this->Jewel->locale = $this->data['Jewel']['eng'];
}
if (!empty($this->data)) {
if ($this->Jewel>save($this->data)) {
$this->flash('Article been saved.', '/articles');
}
}
}
return true;
}


-- 
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: CakePHP developer in Bologna

2012-06-21 Thread marcogo
ciao
io non sono di bologna, ma sono un programmatore cakephp
e lavoro già online con altri partner

marco

On 21 Giu, 07:33, Борислав Събев  wrote:
> You have a private message.
>
> You can check it out.
>
> Cheers,
>    Borislav Sabev.
>
>
>
>
>
>
>
> On Wednesday, 20 June 2012 10:26:45 UTC+3, Cyanto wrote:
>
> > Hi all,
>
> > I'm searching for a developer or a software house located in Bologna,
> > Italy.
>
> > Anybody can help me?
>
> > Thanks in advance.
>
> > Antonio Fracasso

-- 
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


call a function from a view

2012-04-04 Thread marcogo
hello
i want to call a function, from a view, passing an id and get back an
array with some data reads from a table?

where i can declare this function?

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


how to use: insert on duplicate key

2012-03-20 Thread marcogo
Hi,
i want to use sintax like:
INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c
+1;

how to use it?

can i use this->query ??
or i have to set up the model?

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


cakephp 2.0 pagination with search field

2012-02-08 Thread marcogo
HI,
i'm trying to make an pagination search with cakephp 2.0
i want i pagination result with search field filled with the key

in the page i do somethings like this

echo $this->Form->create('News',array('class'=>'form-register'));
echo $this->Form->text('News.search');
echo $this->Form->submit('Ricerca');
echo $this->Paginator->counter(array(   'format' => __('Pagina {:page}
di {:pages}, vedi {:current} risultati di {:count} totali') ));


in controller
$this->News->recursive = 0;
$conditions = array();
  if(!empty($this->data)) {
$search = $this->data['News']['search'];
  } 
elseif($this->Session->check($this->name.'.search')) {
$search = $this->Session->read('News.search');
  }
  echo ' ricerca '.$search;
  if(isset($search)) {
   $input = $search;
   App::import('Sanitize');
   $q = Sanitize::escape($input);
   $conditions = array(" MATCH(titolo,testo) AGAINST('$q'
IN BOOLEAN MODE) ");
   $this->Session->write('News.search', $q);
   $this->set('ilfiltro', $search);
 }
$this->set('ops', $this->paginate($conditions));

how to filled the search field?
how to reset the search?

please apologize my English

-- 
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: cakephp first step

2012-01-22 Thread marcogo
yes i tried to read the book
and make a tutorial too
but i don't understand how to do what i want

thanks

On 22 Gen, 00:23, Sam Sherlock  wrote:
> have you read the blog tutorial of the book it is available in various
> languageshttp://book.cakephp.org/2.0/
>  - S
>
> On 20 January 2012 16:35, marcogo  wrote:
>
>
>
>
>
>
>
> > thanks a lot
> > but where i have to use this instructions?
>
> > thanks again
>
> > On 20 Gen, 16:23, Tilen Majerle  wrote:
> > > create one controller
> > > and there work with 2 tables (models)
>
> > > you can load models on the fly with $this->loadModel('ModelName');
> > > and access to him with $this->ModelName
>
> > >http://api20.cakephp.org/class/controller#method-ControllerloadModel
> > > --
> > > Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> > > 2012/1/20 marcogo 
>
> > > > hi
> > > > please apologize my english
>
> > > > i want to display 2 tables from mysql on the same page
>
> > > > no relationship between 2 table
>
> > > > only show 2 differente tables in a same page...
>
> > > > i try
> > > > make 2 different model
> > > > make 2 different controller
>
> > > > but i can see only the first table, but not the second one
>
> > > > thanks
>
> > > > --
> > > > Our newest site for the community: CakePHP Video Tutorials
> > > >http://tv.cakephp.org
> > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > 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 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: cakephp first step

2012-01-21 Thread marcogo
thanks a lot
but where i have to use this instructions?

thanks again

On 20 Gen, 16:23, Tilen Majerle  wrote:
> create one controller
> and there work with 2 tables (models)
>
> you can load models on the fly with $this->loadModel('ModelName');
> and access to him with $this->ModelName
>
> http://api20.cakephp.org/class/controller#method-ControllerloadModel
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2012/1/20 marcogo 
>
>
>
>
>
>
>
> > hi
> > please apologize my english
>
> > i want to display 2 tables from mysql on the same page
>
> > no relationship between 2 table
>
> > only show 2 differente tables in a same page...
>
> > i try
> > make 2 different model
> > make 2 different controller
>
> > but i can see only the first table, but not the second one
>
> > thanks
>
> > --
> > 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


cakephp first step

2012-01-20 Thread marcogo
hi
please apologize my english

i want to display 2 tables from mysql on the same page

no relationship between 2 table

only show 2 differente tables in a same page...

i try
make 2 different model
make 2 different controller

but i can see only the first table, but not the second one

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