Re: different find results for models null values.

2012-05-08 Thread Michael Gaiser
Thanks.

On Tue, May 8, 2012 at 1:39 PM, euromark  wrote:
> you can usually find the latter in belongsTo relations.
> cake will then return the result with those values set to null.
>
> if you have hasMany relations (a separate query) it doesnt make sense to
> return lots of empty result sets
> and therefore it would just be an empty array
>
>
> Am Dienstag, 8. Mai 2012 18:55:10 UTC+2 schrieb Michael:
>>
>> So sometimes the results for my model finds seem to very between the
>> two formats:
>>
>> $results['Faction'] = array()
>>
>> and
>>
>> $results['Faction'] = array('id'=>null, 'name'=>null)
>>
>>
>> What determines the two? I would prefer that it always give me the
>> listed fields with null values, but I am unsure what is going on to
>> give that. I am toying around with the idea of having a function put
>> into the afterFind() that would add the missing data if needed but it
>> seems a bit clunky.  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


DataSource for CouchDB

2012-05-08 Thread Patrick Jourdan Evangelista Maia
I'm new to CakePHP (and also PHP) and I've started a project that uses it. 
I'd like to implement a DataSource to use with CouchDB and I'm wondering if 
there is some source of information to do so, other than this one: 
http://book.cakephp.org/2.0/en/models/datasources.html. There, I can find 
an example that gives me some hints in how I should implement my 
DataSource, but I'm missing details in what I should expect to receive in 
the parameters of the functions I must implement, what I must return and 
what to do in case of exceptions. 

Thank you

-- 
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: Bake in Cakephp 2.0 give me a code of previus version?!!

2012-05-08 Thread José Lorenzo
Obviously because you have executed the 'cake' command for a previous 
version, make sure you call the shell for 2.0 instead

On Tuesday, May 8, 2012 1:09:24 PM UTC-4:30, gabrielem wrote:
>
> I have downloaded cakephp 2.0 
> I'm learning cakephp, and try to bake model, controller and views...
> I have bake a project to..
>
> But then I have see that the code generated by the bake script is 
> following previulsy convention...
>
> The app_controller file is located in  the main directory and is not in 
> the Controllers directory...
> all the file for controller have the name: nome_controller.php but in 
> cakephp 2.0 must be NameController.php...
>
> wy?
>
> Before of this i did not download previous version of cakephp...
>
>
>
>

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


Bake in Cakephp 2.0 give me a code of previus version?!!

2012-05-08 Thread gabrielem
I have downloaded cakephp 2.0 
I'm learning cakephp, and try to bake model, controller and views...
I have bake a project to..

But then I have see that the code generated by the bake script is following 
previulsy convention...

The app_controller file is located in  the main directory and is not in the 
Controllers directory...
all the file for controller have the name: nome_controller.php but in 
cakephp 2.0 must be NameController.php...

wy?

Before of this i did not download previous version of cakephp...



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


Issue after upgrade from 1.3 to 2.0

2012-05-08 Thread dan
We're in the process of upgrading our existing 1.3 install to 2.0.
After running the upgrade shell, I got this error when trying to load
the main page:

Fatal error: Cannot redeclare config() in /Applications/MAMP/htdocs/
rdi_dev/lib/Cake/basics.php on line 43

When trying to bake, I get the following error:

Fatal error: Cannot redeclare config() (previously declared in /
Applications/MAMP/htdocs/rdi_dev/lib/Cake/basics.php:44) in /
Applications/MAMP/htdocs/rdi_dev/lib/cake/basics.php on line 59

We aren't sure what to look at. We assume that basics.php is being
included somewhere else, but I'm not sure where.

Any help would be greatly appreciated!

-- 
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: Use the comntact model twice but with different required fields

2012-05-08 Thread stork
 

> For my catalog form I would like to use the same model, just need to 
> validate also the fields: street, postcode, city and country.
>

If validation rule doesn't contain 'required' => true, then it is not 
processed, if proper field (key) doesn't exist in model's data. It means - 
just with following validation rules

public $validate = array(
'street' => array(
'rule' => array('minLength', 4),
'message' => 'At least %s characters required',
),
'postcode' => array(
'rule' => array('postal', null, 'us'),
'message' => 'Invalid postal code',
),
'city' => array(
'rule' => array('minLength', 2),
'message' => 'At least %s characters required',
),
);

and 2 contact/add forms (one with these 3 fields, one without them), 
everything should work as you expect. My previous solution makes sense only 
if one wants to allow store empty (optional) values.

-- 
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: Form->month error

2012-05-08 Thread hoss7
yes,thank you

On Tuesday, May 8, 2012 9:16:41 PM UTC+4:30, hoss7 wrote:
>
> hi
>
>
> http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::month
>
> i have run this line
>
> echo $this->Form->month('mob', null, array('monthNames' => false));
>
> and i see this error:*Fatal error*: Unsupported operand types in *
> lib\Cake\View\Helper\FormHelper.php* on line *1990* 
> note: i have cakephp 2.1.2
>

-- 
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: Form->month error

2012-05-08 Thread euromark
i think the docs are outdated in this case.
there are only 2 arguments in 2.x
see the class itself for details.
(any decent IDE would have pointed that out to you directly, though)


Am Dienstag, 8. Mai 2012 18:46:41 UTC+2 schrieb hoss7:
>
> hi
>
>
> http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::month
>
> i have run this line
>
> echo $this->Form->month('mob', null, array('monthNames' => false));
>
> and i see this error:*Fatal error*: Unsupported operand types in *
> lib\Cake\View\Helper\FormHelper.php* on line *1990* 
> note: i have cakephp 2.1.2
>

-- 
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: Does the community intend to localize CakePHP core or its default app/?

2012-05-08 Thread Thiago Colares
about the folder: Oh, of course!! Thanks for notice me, I didn't connect 
the dots: the core's localization .po goes in the app folder, that is it?

yeah, I agree this is really a hard work and important. I just asked 
because I'm about to start to colaborate on translations (terms or 
cookbook) too, then started to looking for some initiative or already 
started project, instead of just start some repeated stuff. Is there some 
existent repository with cakephp's core localizations?

On Tuesday, May 8, 2012 12:39:33 PM UTC-3, Điển vũ wrote:
>
> /app/Locale/fre/LC_MESSAGES/cake.po (French)
>>
>> create cake.po use PoEdit to translate it . It take you several hours to 
> translate , not lost too much your time .. 
> When you done with translations then post a article to 
> http://bakery.cakephp.org
>

-- 
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: different find results for models null values.

2012-05-08 Thread euromark
you can usually find the latter in belongsTo relations.
cake will then return the result with those values set to null.

if you have hasMany relations (a separate query) it doesnt make sense to 
return lots of empty result sets
and therefore it would just be an empty array


Am Dienstag, 8. Mai 2012 18:55:10 UTC+2 schrieb Michael:
>
> So sometimes the results for my model finds seem to very between the 
> two formats: 
>
> $results['Faction'] = array() 
>
> and 
>
> $results['Faction'] = array('id'=>null, 'name'=>null) 
>
>
> What determines the two? I would prefer that it always give me the 
> listed fields with null values, but I am unsure what is going on to 
> give that. I am toying around with the idea of having a function put 
> into the afterFind() that would add the missing data if needed but it 
> seems a bit clunky.  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


different find results for models null values.

2012-05-08 Thread Michael Gaiser
So sometimes the results for my model finds seem to very between the
two formats:

$results['Faction'] = array()

and

$results['Faction'] = array('id'=>null, 'name'=>null)


What determines the two? I would prefer that it always give me the
listed fields with null values, but I am unsure what is going on to
give that. I am toying around with the idea of having a function put
into the afterFind() that would add the missing data if needed but it
seems a bit clunky.  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


belongs to in cake 2.x

2012-05-08 Thread Don Taylor
HHiHi,
I have Servers and People table. Hi,
Hi,

Using cake version 2.x.

I have Servers and People table

All sys admins contact are put into People table. 

Each server has *one* primary sys admin, and *one* secondary sys admin. I 
create primary_sys_admin_id and secondary_sys_admin_id in Servers table to 
point to respective sysadmin in People table. 

I read the group archive and from that I defined Server Model as following: 
http://pastebin.com/zy0iQjf6  

By my model, I will at least need to create mysql view PrimarySysAdmin to 
mirror People and also SecondarySysAdmin view to mirror People. 

Am I doing it the right way ?

Thanks
Don

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


Form->month error

2012-05-08 Thread hoss7
hi

http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::month

i have run this line

echo $this->Form->month('mob', null, array('monthNames' => false));

and i see this error:*Fatal error*: Unsupported operand types in *
lib\Cake\View\Helper\FormHelper.php* on line *1990* 
note: i have cakephp 2.1.2

-- 
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: Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread Ludovic FERRE
Thanks Vikram, it was a user error indeed  as I forgot to set the Id as
primary key not null auto_imcrement!
Le 8 mai 2012 15:18, "vikram sharma"  a écrit :

> hi Ludovic Plese check these in your site i hope these work for you.
>
>1. Make sure you set up your DATABASE_CONFIG is setup correctly
>(database.php)
>2. Check that your tmp folder (and all of it’s sub folders) are
>writable (at least chmod 666 on Linux),
>3. While you’re there delete all cache files from *all*of the tmp sub
>folders
>
>
>
> On Tue, May 8, 2012 at 4:37 PM, Ludovic Ferre wrote:
>
>> I am new to CakePHP and am following the Packt Publishing book to get
>> used to the tool (and challenge myself following 1.2 wirtten apps on
>> 2.1.2). It's working well however I am stuck with basic scaffold as
>> described in the books and online documentation.
>>
>> I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.
>>
>> The SQL table in my db is defined here:
>>
>> CREATE TABLE `books` (
>>   `id` int(11) DEFAULT NULL,
>>   `isbn` varchar(10) NOT NULL,
>>   `title` varchar(127) NOT NULL,
>>   `description` text NOT NULL,
>>   `author_name` varchar(127) NOT NULL
>> ) ENGINE=InnoDB DEFAULT CHARSET=latin1
>>
>>
>> In app/Model/ I have the following book.php:
>>
>> > class Book extends AppModel {
>>  var $name = 'Book';
>> }
>> ?>
>>
>>
>> In app/Controller/BooksController.php:
>>
>> > class BooksController extends AppController {
>>  var $name = 'Books';
>> var $scaffold;
>> }
>> ?>
>>
>>
>> Now if I go to my test application (Available on the Internet, so you can
>> check it out) http://15-sign.15-cloud.fr/Bakery/books it works with the
>> Add function, but View / Edit / Delete  all return errors like:
>>
>> *Error: *The requested address *'/Bakery/books/view'* was not found on
>> this server.
>> *
>> *
>> *Error: *The requested address *'/Bakery/books/edit'* was not found on
>> this server.
>> *
>> *
>> *Error: *The requested address *'/Bakery/books/delete'* was not found on
>> this server.
>>
>> What is causing these errors, is this a bug in the scaffold code?
>>
>> Thanks in advance,
>> Ludovic
>>
>> --
>> 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
>>
>
>
>
> --
>
> *
> Thanks & Regards**
> **Vikram Sharma  | Cell +9466205050 |*
> *E-Mail :  vikramka...@gmail.com |  *
> *>>> My Quotes *
> *
>
> 
> **
> **
>
> 
>
>
> *
>
>  --
> 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: User Management Plugin Cakephp 2

2012-05-08 Thread Điển vũ
https://github.com/cakedc 
search *users* , this plugin stable at 95%  , 5% isn't table . but it is 
good, you can see and get code from it .
Now , it is best, if you develop users magnagement for yourself. Then you 
can easier to fix any errors happen.

-- 
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: User Management Plugin Cakephp 2

2012-05-08 Thread Điển vũ
https://github.com/cakedc 
search *users* , this plugin is stable at 95%  , 5% isn't stable . but it 
is good, you can see and get code from it .
Now , it is best, if you develop users magnagement for yourself. Then you 
can easier to fix any errors happen.

-- 
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: Server Move: Catch old details page url and forward to cake style url

2012-05-08 Thread Thiago Belem
CakePHP 2.0 has Router::redirect()

http://book.cakephp.org/2.0/en/development/routing.html#redirect-routing


--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

*Assando Sites* - Curso online de *CakePHP*
assando-sites.com.br 

thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt



On Tue, May 8, 2012 at 12:46 PM, Điển vũ  wrote:

> Put this code ( modify it fit with your code ) in boostrap.php
>
>  if (preg_match('/details\.php?id=(.*)/', $_SERVER['REQUEST_URI'],
> $match) !== false) {
>if (isset($match[1])){
> $location = '/details/index/' . $match[1]
>  header('Location: ' . $location, true, 301);
>  die();
>}
> }
>
>  --
> 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: Server Move: Catch old details page url and forward to cake style url

2012-05-08 Thread Điển vũ
Put this code ( modify it fit with your code ) in boostrap.php
   
 if (preg_match('/details\.php?id=(.*)/', $_SERVER['REQUEST_URI'], 
$match) !== false) {
   if (isset($match[1])){
$location = '/details/index/' . $match[1]
 header('Location: ' . $location, true, 301);
 die();
   }
}

-- 
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: Does the community intend to localize CakePHP core or its default app/?

2012-05-08 Thread Điển vũ

>
> /app/Locale/fre/LC_MESSAGES/cake.po (French)
>
> create cake.po use PoEdit to translate it . It take you several hours to 
translate , not lost too much your time .. 
When you done with translations then post a article to 
http://bakery.cakephp.org

-- 
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-php@googlegroups.com

2012-05-08 Thread jeremyharris
I answered on ask.cakephp.org for a long time, but it logged me out on a 
regular basis and didn't give me notifications when people commented or 
asked further questions, so I would have to revisit questions just to see 
the activity. I've started answering on StackOverflow instead. I agree that 
Ask had potential but I just don't think it received the love it needed. 

On Friday, May 4, 2012 10:29:37 AM UTC-7, Xoubaman wrote:
>
> When I found that there is such a way to ask for help, I start to use it 
> and answer the questions I know how to, moving my "help activity" from this 
> group to Q&A.
>
> But, after some time, I realized that the Q&A service is quite 
> "abandoned", much less healthy than the google group and almost hidden in 
> the Cake website (just a link in the top menu, whit the group much more 
> visible an accesible).
>
> I think that centralize all in just one place (due to activity, this 
> group) will be better than split the users in two sites. Not a big problem 
> at all and no intention to blame anyone, just a personal thought.
>

-- 
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: Many database requests -> Cake is to slow

2012-05-08 Thread Phang Mulianto
hi,

what is your speed expectation ? do you have any minimum and maximum time
limit ?

why not try to do the save only once...like firing all the insert in 1 shot
to the db.

or just create raw insert command and run the execute..



On Tue, May 8, 2012 at 12:27 AM, John Hardy  wrote:

> While code optimization should be done, i would be more interested in your
> network, database setup/tuning and your hardware specs.
>
> Test your algorithm outside of the cake framework to compare speeds
>  On May 7, 2012 7:48 AM, "supp...@deep-coding.net" <
> supp...@deep-coding.net> wrote:
>
>> Hey,
>>
>> I have a problem, I have to handle many database requests, but it
>> tooks to much time.
>> The user can upload a xml file, then I am running a foreach, to create
>> an array from the data of the xml file.
>> Then I am saving this data with the save() method, but it tooks to
>> much time.
>> For testing I have uploaded a file with 1,200 datasets and it tooks 24
>> seconds to read all datasets, create the arrays and save it into the
>> database.
>> I don't know what I can do to rush it up.
>> Can anyone help me please?
>>
>> Thanks Alex
>>
>> --
>> 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


Server Move: Catch old details page url and forward to cake style url

2012-05-08 Thread heohni
Hi,

I am just about relaunching a website and they gave out tons of QR Codes 
with links like:
www.domain.com/detail.php?id=1234
What can I do to catch all this domains having the "details.php?Id=" and 
forward this to (controller=>detail action=>index, 1234)
Is there a way to handle this with Router::connect rules?

Thanks for any help!

-- 
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: Use the comntact model twice but with different required fields

2012-05-08 Thread heohni
Hi Stork,

thanks so much for your answer.

I have these fields for my basic contact form: first_name, last_name, email 
and phone.
For my catalog form I would like to use the same model, just need to 
validate also the fields: street, postcode, city and country.

What you do, is to "kind of ignore" rules. Which is a great way of doing it 
by the way!
But what I want to do is to _add_ rule just in that particular case of the 
catalog order form.

What would you suggest?
Or didn't I get the sense out of your post?

Thanks!


Am Montag, 7. Mai 2012 13:08:30 UTC+2 schrieb heohni:
>
> Hi,
>
> I would like to use the contact model on 2 pages.
> The main contact form, street, postcode and city is not a required field.
> And a simple order form for catalogs where those fields are required.
>
> Is that possible?
> To have - based on the form -  additional fields which need to pass the 
> validation routine?
>
> 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: Little help with routes and links

2012-05-08 Thread Jeremy Burns | Class Outfit
Can you throw some background on what you are trying to achieve (why these 
links?)?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 8 May 2012, at 14:29:16, Mike Griffin wrote:

> On Tue, May 8, 2012 at 1:26 PM, Confused Dev  wrote:
>> Hello.
>> I'd like to have links like this:
>> http://example.com/items/blue/bowl/1
>> 
>> I don't even know where to begin to make it produce automatic links
>> like that. Any help would be greatly appreciated.
> 
> You could try something like this, it probably won't work as written,
> but it might give you a starting point.
> 
> Router::connect(
>'/items/:colour/:item/:number',
>array('controller' => 'items', 'action' => 'index', 'number' => null),
>array(
>'colour' => '\w+',
>'item' => '\w+',
>'number' => '\d+'
>)
> );
> 
> Also, have a look at
> http://book.cakephp.org/2.0/en/development/routing.html#passing-parameters-to-action
> 
> Mike.
> 
> -- 
> 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: Little help with routes and links

2012-05-08 Thread Mike Griffin
On Tue, May 8, 2012 at 1:26 PM, Confused Dev  wrote:
> Hello.
> I'd like to have links like this:
> http://example.com/items/blue/bowl/1
>
> I don't even know where to begin to make it produce automatic links
> like that. Any help would be greatly appreciated.

You could try something like this, it probably won't work as written,
but it might give you a starting point.

Router::connect(
'/items/:colour/:item/:number',
array('controller' => 'items', 'action' => 'index', 'number' => null),
array(
'colour' => '\w+',
'item' => '\w+',
'number' => '\d+'
)
);

Also, have a look at
http://book.cakephp.org/2.0/en/development/routing.html#passing-parameters-to-action

Mike.

-- 
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: Little help with routes and links

2012-05-08 Thread Michael Stelly
I'm not an expert on routes, either. But I would start here to find
out.Routing Cookbook
v2

Sincerely,
Michael Stelly
mobile: +1.918.978.2000
skype: mjstelly
LinkedIn 



On Tue, May 8, 2012 at 7:26 AM, Confused Dev wrote:

> Hello.
>
> I need help with defining some unusual routes.
>
> Here are my 2 tables Colors and Products:
>
> mysql> select * from colors;
> ++--+
> | id | name |
> ++--+
> |  1 | blue |
> ++--+
>
> mysql> select * from products;
> ++--+--+
> | id | name | color_id |
> ++--+--+
> |  1 | bowl |1 |
> ++--+--+
>
>
> Normally Cake will produce links like this:
> http://example.com/products/view/1
>
> I'd like to have links like this:
> http://example.com/items/blue/bowl/1
>
> I don't even know where to begin to make it produce automatic links
> like that. Any help would be greatly appreciated.
>
> --
> 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: Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread vikram sharma
hi Ludovic Plese check these in your site i hope these work for you.

   1. Make sure you set up your DATABASE_CONFIG is setup correctly
   (database.php)
   2. Check that your tmp folder (and all of it’s sub folders) are writable
   (at least chmod 666 on Linux),
   3. While you’re there delete all cache files from *all*of the tmp sub
   folders



On Tue, May 8, 2012 at 4:37 PM, Ludovic Ferre wrote:

> I am new to CakePHP and am following the Packt Publishing book to get used
> to the tool (and challenge myself following 1.2 wirtten apps on 2.1.2).
> It's working well however I am stuck with basic scaffold as described in
> the books and online documentation.
>
> I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.
>
> The SQL table in my db is defined here:
>
> CREATE TABLE `books` (
>   `id` int(11) DEFAULT NULL,
>   `isbn` varchar(10) NOT NULL,
>   `title` varchar(127) NOT NULL,
>   `description` text NOT NULL,
>   `author_name` varchar(127) NOT NULL
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1
>
>
> In app/Model/ I have the following book.php:
>
>  class Book extends AppModel {
>  var $name = 'Book';
> }
> ?>
>
>
> In app/Controller/BooksController.php:
>
>  class BooksController extends AppController {
>  var $name = 'Books';
> var $scaffold;
> }
> ?>
>
>
> Now if I go to my test application (Available on the Internet, so you can
> check it out) http://15-sign.15-cloud.fr/Bakery/books it works with the
> Add function, but View / Edit / Delete  all return errors like:
>
> *Error: *The requested address *'/Bakery/books/view'* was not found on
> this server.
> *
> *
> *Error: *The requested address *'/Bakery/books/edit'* was not found on
> this server.
> *
> *
> *Error: *The requested address *'/Bakery/books/delete'* was not found on
> this server.
>
> What is causing these errors, is this a bug in the scaffold code?
>
> Thanks in advance,
> Ludovic
>
> --
> 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
>



-- 

*
Thanks & Regards**
**Vikram Sharma  | Cell +9466205050 |*
*E-Mail :  vikramka...@gmail.com |  *  *>>>
My Quotes *
*


**
**




*

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


Little help with routes and links

2012-05-08 Thread Confused Dev
Hello.

I need help with defining some unusual routes.

Here are my 2 tables Colors and Products:

mysql> select * from colors;
++--+
| id | name |
++--+
|  1 | blue |
++--+

mysql> select * from products;
++--+--+
| id | name | color_id |
++--+--+
|  1 | bowl |1 |
++--+--+


Normally Cake will produce links like this:
http://example.com/products/view/1

I'd like to have links like this:
http://example.com/items/blue/bowl/1

I don't even know where to begin to make it produce automatic links
like that. Any help would be greatly appreciated.

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


Does the community intend to localize CakePHP core or its default app/?

2012-05-08 Thread Thiago Colares
I was wondering how relevant is to translate* CakePHP core terms or its
default app/. Are there core translations initiatives by the community or
the biggest effort is focused on CookBook??

* I'm talkin about terms, not validation rules.

By the way, how to localize core terms? Where should I supposed to put the
.po files?

Thanks indeed!

--
Thiago Colares
@thicolares 
apimenti.com.br
71 3334-5034

-- 
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: Repeated SQL Error: 2006: MySQL server has gone away

2012-05-08 Thread Dixon Thankachan

Hi,
   I also have the same problem with cake php application, SQL Error: 
2006: MySQL server has gone away [CORE/cake/libs/model/
datasources/dbo_source.php line 673]. can anyone help?... it's urgent

-- 
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: Translate Behavior Save and Validate more languages

2012-05-08 Thread manzapanza
Some suggestions?
Thanks!

Il giorno lunedì 7 maggio 2012 10:33:41 UTC-3, manzapanza ha scritto:
>
> I'm trying to Save and Validate categories with 3 translations for the 
> field 'name' using TranslateBehavior. 
> I have a problem with the validation of the field with Translation. 
>
> Model/Category.php
>
> public $actsAs = array('Translate' => array('name' => 'MyTranslateName'));
>> public $validate = array(
>> 'name' => array(
>> 'notempty' => array(
>> 'rule' => array('notempty'),
>> 'message' => 'Error notempty',
>> ),
>> ),
>> ...
>> );
>>
>
> View/Categories/admin_edit.ctp:
>
> echo $this->Form->create('Category');
>> echo $this->Form->input('Category.name.deu', array('label' => 
>> __d('Category', 'Name Deu')));
>> echo $this->Form->input('Category.name.eng', array('label' => 
>> __d('Category', 'Name Eng')));
>> echo $this->Form->input('Category.name.ita', array('label' => 
>> __d('Category', 'Name Ita')));
>> echo $this->Form->end(__d('app', 'Submit'));
>>
>
> In the controller I use simply the save() method and the behavior store 3 
> records correctly in i18n table but the all three values are not validated.
> Is validated only the field of language = $this->Category->locale but in 
> case of a error the error is returned for Category.name field and not for 
> Category.name.eng and for this error messages are not displayed...
>
> How can I do to validate translations in the same form?
>
> Thanks!
> Massimo
>

-- 
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: Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread Ludovic FERRE
Ah ah.

It's all fixed.

Thanks for the quick check. I'll remember that one!

On Tue, May 8, 2012 at 2:13 PM, Ludovic FERRE wrote:

> Dang, of course I should. Let me correct that now :D.
>
>
>
> On Tue, May 8, 2012 at 2:11 PM, Ludovic FERRE wrote:
>
>> You are absolutely right.
>>
>> So should I set the ID filed to autoincrement or would the scaffold take
>> care of that?
>>
>> Ludovic
>>
>>
>> On Tue, May 8, 2012 at 2:02 PM, Andras Kende  wrote:
>>
>>> Check id field in the db
>>> It looks like they are empty
>>>
>>> Andras Kende
>>> 214 799 1177
>>> and...@kende.com
>>> http://www.kende.com
>>>
>>> On May 8, 2012, at 4:07, Ludovic Ferre  wrote:
>>>
>>> I am new to CakePHP and am following the Packt Publishing book to get
>>> used to the tool (and challenge myself following 1.2 wirtten apps on
>>> 2.1.2). It's working well however I am stuck with basic scaffold as
>>> described in the books and online documentation.
>>>
>>> I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.
>>>
>>> The SQL table in my db is defined here:
>>>
>>> CREATE TABLE `books` (
>>>   `id` int(11) DEFAULT NULL,
>>>   `isbn` varchar(10) NOT NULL,
>>>   `title` varchar(127) NOT NULL,
>>>   `description` text NOT NULL,
>>>   `author_name` varchar(127) NOT NULL
>>> ) ENGINE=InnoDB DEFAULT CHARSET=latin1
>>>
>>>
>>> In app/Model/ I have the following book.php:
>>>
>>> >> class Book extends AppModel {
>>>  var $name = 'Book';
>>> }
>>> ?>
>>>
>>>
>>> In app/Controller/BooksController.php:
>>>
>>> >> class BooksController extends AppController {
>>>  var $name = 'Books';
>>> var $scaffold;
>>> }
>>> ?>
>>>
>>>
>>> Now if I go to my test application (Available on the Internet, so you
>>> can check it out) http://15-sign.15-cloud.fr/Bakery/books it works with
>>> the Add function, but View / Edit / Delete  all return errors like:
>>>
>>> *Error: *The requested address *'/Bakery/books/view'* was not found on
>>> this server.
>>> *
>>> *
>>> *Error: *The requested address *'/Bakery/books/edit'* was not found on
>>> this server.
>>> *
>>> *
>>> *Error: *The requested address *'/Bakery/books/delete'* was not found
>>> on this server.
>>>
>>> What is causing these errors, is this a bug in the scaffold code?
>>>
>>> Thanks in advance,
>>> Ludovic
>>>
>>> --
>>> 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
>>>
>>
>>
>>
>> --
>> Ludovic
>>
>
>
>
> --
> Ludovic
>



-- 
Ludovic

-- 
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: Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread Ludovic FERRE
Dang, of course I should. Let me correct that now :D.



On Tue, May 8, 2012 at 2:11 PM, Ludovic FERRE wrote:

> You are absolutely right.
>
> So should I set the ID filed to autoincrement or would the scaffold take
> care of that?
>
> Ludovic
>
>
> On Tue, May 8, 2012 at 2:02 PM, Andras Kende  wrote:
>
>> Check id field in the db
>> It looks like they are empty
>>
>> Andras Kende
>> 214 799 1177
>> and...@kende.com
>> http://www.kende.com
>>
>> On May 8, 2012, at 4:07, Ludovic Ferre  wrote:
>>
>> I am new to CakePHP and am following the Packt Publishing book to get
>> used to the tool (and challenge myself following 1.2 wirtten apps on
>> 2.1.2). It's working well however I am stuck with basic scaffold as
>> described in the books and online documentation.
>>
>> I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.
>>
>> The SQL table in my db is defined here:
>>
>> CREATE TABLE `books` (
>>   `id` int(11) DEFAULT NULL,
>>   `isbn` varchar(10) NOT NULL,
>>   `title` varchar(127) NOT NULL,
>>   `description` text NOT NULL,
>>   `author_name` varchar(127) NOT NULL
>> ) ENGINE=InnoDB DEFAULT CHARSET=latin1
>>
>>
>> In app/Model/ I have the following book.php:
>>
>> > class Book extends AppModel {
>>  var $name = 'Book';
>> }
>> ?>
>>
>>
>> In app/Controller/BooksController.php:
>>
>> > class BooksController extends AppController {
>>  var $name = 'Books';
>> var $scaffold;
>> }
>> ?>
>>
>>
>> Now if I go to my test application (Available on the Internet, so you can
>> check it out) http://15-sign.15-cloud.fr/Bakery/books it works with the
>> Add function, but View / Edit / Delete  all return errors like:
>>
>> *Error: *The requested address *'/Bakery/books/view'* was not found on
>> this server.
>> *
>> *
>> *Error: *The requested address *'/Bakery/books/edit'* was not found on
>> this server.
>> *
>> *
>> *Error: *The requested address *'/Bakery/books/delete'* was not found on
>> this server.
>>
>> What is causing these errors, is this a bug in the scaffold code?
>>
>> Thanks in advance,
>> Ludovic
>>
>> --
>> 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
>>
>
>
>
> --
> Ludovic
>



-- 
Ludovic

-- 
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: Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread Ludovic FERRE
You are absolutely right.

So should I set the ID filed to autoincrement or would the scaffold take
care of that?

Ludovic

On Tue, May 8, 2012 at 2:02 PM, Andras Kende  wrote:

> Check id field in the db
> It looks like they are empty
>
> Andras Kende
> 214 799 1177
> and...@kende.com
> http://www.kende.com
>
> On May 8, 2012, at 4:07, Ludovic Ferre  wrote:
>
> I am new to CakePHP and am following the Packt Publishing book to get used
> to the tool (and challenge myself following 1.2 wirtten apps on 2.1.2).
> It's working well however I am stuck with basic scaffold as described in
> the books and online documentation.
>
> I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.
>
> The SQL table in my db is defined here:
>
> CREATE TABLE `books` (
>   `id` int(11) DEFAULT NULL,
>   `isbn` varchar(10) NOT NULL,
>   `title` varchar(127) NOT NULL,
>   `description` text NOT NULL,
>   `author_name` varchar(127) NOT NULL
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1
>
>
> In app/Model/ I have the following book.php:
>
>  class Book extends AppModel {
>  var $name = 'Book';
> }
> ?>
>
>
> In app/Controller/BooksController.php:
>
>  class BooksController extends AppController {
>  var $name = 'Books';
> var $scaffold;
> }
> ?>
>
>
> Now if I go to my test application (Available on the Internet, so you can
> check it out) http://15-sign.15-cloud.fr/Bakery/books it works with the
> Add function, but View / Edit / Delete  all return errors like:
>
> *Error: *The requested address *'/Bakery/books/view'* was not found on
> this server.
> *
> *
> *Error: *The requested address *'/Bakery/books/edit'* was not found on
> this server.
> *
> *
> *Error: *The requested address *'/Bakery/books/delete'* was not found on
> this server.
>
> What is causing these errors, is this a bug in the scaffold code?
>
> Thanks in advance,
> Ludovic
>
> --
> 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
>



-- 
Ludovic

-- 
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: Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread Andras Kende
Check id field in the db 
It looks like they are empty 

Andras Kende
214 799 1177
and...@kende.com
http://www.kende.com

On May 8, 2012, at 4:07, Ludovic Ferre  wrote:

> I am new to CakePHP and am following the Packt Publishing book to get used to 
> the tool (and challenge myself following 1.2 wirtten apps on 2.1.2). It's 
> working well however I am stuck with basic scaffold as described in the books 
> and online documentation.
> 
> I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.
> 
> The SQL table in my db is defined here:
> 
> CREATE TABLE `books` (
>   `id` int(11) DEFAULT NULL,
>   `isbn` varchar(10) NOT NULL,
>   `title` varchar(127) NOT NULL,
>   `description` text NOT NULL,
>   `author_name` varchar(127) NOT NULL
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1
> 
> In app/Model/ I have the following book.php:
> 
>  class Book extends AppModel {
>   
>   var $name = 'Book';
> }
> ?>
> 
> In app/Controller/BooksController.php:
> 
>  class BooksController extends AppController {
>   
>   var $name = 'Books';
>   var $scaffold;
> }
> ?>
> 
> Now if I go to my test application (Available on the Internet, so you can 
> check it out) http://15-sign.15-cloud.fr/Bakery/books it works with the Add 
> function, but View / Edit / Delete  all return errors like:
> 
> Error: The requested address '/Bakery/books/view' was not found on this 
> server.
> 
> Error: The requested address '/Bakery/books/edit' was not found on this 
> server.
> 
> Error: The requested address '/Bakery/books/delete' was not found on this 
> server.
> 
> What is causing these errors, is this a bug in the scaffold code?
> 
> Thanks in advance,
> Ludovic
> -- 
> 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: Error using twitter boostrap plugin on cakephp 2.0

2012-05-08 Thread Paulo de Almeida
jhonnatas where did you find it? Please share the link, i configured the
twitter bootstrap manually in my project.

2012/5/7 blaster 

> Hi everyone!I need some help!
> I'm trying to use twitterbootstrap plugin on cakephp 2.0.I was
> following the tutorial from github and it says that I have to put the
> plugin in "app/Plugin/TwitterBootstrap/webroot" folder.I didt it and
> loaded all the plugins with "CakePlugin::loadAll()" and it also says
> that I have to edit the AppController.php file and add:
>
> public $helpers = array(
>'Session', 'Html', 'Form',
>'TwitterBootstrap.BootstrapHtml',
>'TwitterBootstrap.BootstrapForm',
>'TwitterBootstrap.BootstrapPaginator',
>);
>
> but when I finish doing that it shows that error:
>
> "Helper class BootstrapHtmlHelper could not be found.
>
> Error: An Internal Error Has Occurred."
>
> Those files are located in: "Plugin/TwitterBootstrap/webroot/View/
> Helper" I found them there but cakephp says they are missing!
>
> Please someone help!
> Thanks in advance!
>
> Please excuse 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
>



-- 
Paulo de Almeida

Linux User #494076
Ubuntu User # 28289

"In a world without walls who needs windows and gates?"

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


Scaffold with CakePHP 2.1.2 works with Add but Edit/View/Delete all cause errors

2012-05-08 Thread Ludovic Ferre
I am new to CakePHP and am following the Packt Publishing book to get used 
to the tool (and challenge myself following 1.2 wirtten apps on 2.1.2). 
It's working well however I am stuck with basic scaffold as described in 
the books and online documentation.

I am running MySQL 5.5 on Ubuntu Linux 12.04 amd64.

The SQL table in my db is defined here:

CREATE TABLE `books` (
  `id` int(11) DEFAULT NULL,
  `isbn` varchar(10) NOT NULL,
  `title` varchar(127) NOT NULL,
  `description` text NOT NULL,
  `author_name` varchar(127) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1


In app/Model/ I have the following book.php:




In app/Controller/BooksController.php:




Now if I go to my test application (Available on the Internet, so you can 
check it out) http://15-sign.15-cloud.fr/Bakery/books it works with the Add 
function, but View / Edit / Delete  all return errors like:

*Error: *The requested address *'/Bakery/books/view'* was not found on this 
server.
*
*
*Error: *The requested address *'/Bakery/books/edit'* was not found on this 
server.
*
*
*Error: *The requested address *'/Bakery/books/delete'* was not found on 
this server.

What is causing these errors, is this a bug in the scaffold code?

Thanks in advance,
Ludovic

-- 
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: Use the comntact model twice but with different required fields

2012-05-08 Thread stork
Let's say that your current validation rules in model Contact looks like:

public $validate = array(
'street' => array(
'allowEmpty' => true,
'rule' => array('minLength', 4),
'message' => 'At least %s characters required',
),
'postcode' => array(
'allowEmpty' => true,
'rule' => array('postal', null, 'us'),
'message' => 'Invalid postal code',
),
'city' => array(
'allowEmpty' => true,
'rule' => array('minLength', 2),
'message' => 'At least %s characters required',
),
);

then you can implement beforeValidate callback in this model:

public function beforeValidate($options = array()) {
$allowEmpty = empty($this->data[$this->alias]['details']);
foreach (array('street', 'postcode', 'city') as $field) {
$this->validate[$field]['allowEmpty'] = $allowEmpty;
}
return parent::beforeValidate($options);
}

and in contact form where contact details are required just

echo $this->Form->input('Contact.details', array('type' => 'hidden', 
'value' => '1'));

-- 
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: Ajax Pagination only works once (no javascript loaded)

2012-05-08 Thread Timo Respondek
Thank you for your input, lowpass, and excuse my late reply.

I found out that what I had to do to get it to work the way  I thought
it would work was quite simple - despite my having echo
$this->Js->writeBuffer(); at the end of my default-layout, I've
included the line on every, which of course isn't all too elegant, but
somehow just having it in my default layout doesn't work.


Timo

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


Error using twitter boostrap plugin on cakephp 2.0

2012-05-08 Thread blaster
Hi everyone!I need some help!
I'm trying to use twitterbootstrap plugin on cakephp 2.0.I was
following the tutorial from github and it says that I have to put the
plugin in "app/Plugin/TwitterBootstrap/webroot" folder.I didt it and
loaded all the plugins with "CakePlugin::loadAll()" and it also says
that I have to edit the AppController.php file and add:

public $helpers = array(
'Session', 'Html', 'Form',
'TwitterBootstrap.BootstrapHtml',
'TwitterBootstrap.BootstrapForm',
'TwitterBootstrap.BootstrapPaginator',
);

but when I finish doing that it shows that error:

"Helper class BootstrapHtmlHelper could not be found.

Error: An Internal Error Has Occurred."

Those files are located in: "Plugin/TwitterBootstrap/webroot/View/
Helper" I found them there but cakephp says they are missing!

Please someone help!
Thanks in advance!

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