Re: Scaffolding and Model Relationships

2009-08-22 Thread gerhardsletten

Hi Jeff

Have experienced the same too. Also I have found that the templates I
get after I have baked the views differ from what I have when only
using the shaffold function.

Gerhard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: clearCache() unexpected behavior

2009-08-11 Thread gerhardsletten

Think it only deletes files under tmp/cache/views
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Is it possible to check to see if model exists?

2009-07-10 Thread gerhardsletten

Mayby you have to use the try.. catch also

http://mark-story.com/posts/view/simplifying-controller-logic-with-exceptions
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Call ClassRegistry::init in bootstrap.php

2009-07-06 Thread gerhardsletten

Put the code you had in bootstrap in your main app_controller.php in
the beforeFilter() function
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: How to Save Configuration in Database

2009-07-02 Thread gerhardsletten

Have made a plugin for this named Settings:

http://code.google.com/p/gerhardsletten/source/browse/trunk/cakephp/plugins/settings/docs/readme.textile
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: What's best way to create the Admin area?

2009-06-08 Thread gerhardsletten

Go with conversions.

If your app allow full crud for regular users, you might not need to
create a admin controller functions/views for that model. Also try to
ignor the desire to "mod" everything. What you get baked will often do
the job, even though it's not as sexy as the wordpress backend.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Settings plugin that controlls Configure

2009-06-07 Thread gerhardsletten

Hi, just made this plugin that imports your config/core.php settings
into database and makes it possible to easy controll them in your
backend.

http://code.google.com/p/gerhardsletten/source/browse/#svn/trunk/cakephp/plugins/settings

I "override" the default settings in app_controller.php:

function beforeFilter() {
parent::beforeFilter();
App::import("Model", "Settings.Setting");
$setting = new Setting;
$setting->writeSettings();

return true;
}

The $setting->writeSettings() function will read in settings from the
database.

Is there a better way according to the performance and cache to do
this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Problem Uploading Flash

2009-05-31 Thread gerhardsletten

MeioUpload is made for images..

If you have modified it, to handle all kinds of files, check to see if
you can upload other kind of files.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Bug? Plugin and controller with same name

2009-05-10 Thread gerhardsletten

Experience a bug with cake_1.2.3.8166 where I have a Posts plugin that
has a controller with same name. When I try to redirect to the index
function cake adds ":controller" in the end.

I get this url:
http://localhost/~gerhard/gersh.no/admin/posts/:controller

Anybody who knows if thats a bug?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Disable Cache Dynamically

2009-05-08 Thread gerhardsletten

I am planning a settingsplugin, which reads all default settings in
setting/core.php and then gives admin a interface to "override" these
setting, storing them in a table.

Is it possible to use a

App::import('Model', 'Settings');

in either core.php or bootstrap.php and itterate through the whole
table and do at Configure::Write for this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Offline version of the CakePHP manual.

2009-04-07 Thread gerhardsletten

Guess the same goes for the api..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: switching databases on dev and production

2009-02-11 Thread gerhardsletten

Read this today:

switch($_SERVER['SERVER_NAME']){
case ‘digbiz.localhost’:
$this->default = $this->dev;
break;
case ‘digbiz.example.com’:
$this->default = $this->prod;
break;
default:
// we are likely baking, use our local db
$this->default = $this->dev;
}

via 
http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp

My own solution, since I am using code.google.com for some of my
projects:

database.php:



Moving my database settings out of the app directory
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: svn or git?

2009-01-30 Thread gerhardsletten

I use the Textmate Bundle SVNMate (http://ciaranwal.sh/2007/11/29/
svnmate-update) its really wonderfull working with. And on office
where we use svn+ssh protocol it even supports that to.

Also have the svnX, but its a little more hazzle working with.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: nice new API layout

2009-01-29 Thread gerhardsletten

Kudos!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: twitter users?

2009-01-26 Thread gerhardsletten

http://www.twitter.com/gerhardsletten

A salty mix of cake, ez publish, triathlon, food and live. Code stuff
mostly in english, but some norwegian now and than

On Jan 25, 5:33 pm, Marcelo Andrade  wrote:
> http://twitter.com/mfandrade
>
> Mainly in portuguese.
>
> --
> MARCELO DE F. ANDRADE (aka "eleKtron")
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
>
> For Libby's backstory be told on 
> Losthttp://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple Uploads with MeioUpload

2009-01-26 Thread gerhardsletten

Are using MeioUpload on my last project to as Article has many
Uploads. When editing an article you can upload one and one image.
Your will find source here:
http://code.google.com/p/gerhardsletten/source/browse/trunk/cakephp/surdeig/models/upload.php?r=6

If you need your app to upload all in one bunsh, I guess you can use
the $model->saveAll() and add several uploadsfields in an array.
Search in this group for "save multiple" or "saveall"



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



App::import fail to load Component for imported controller

2009-01-19 Thread gerhardsletten

Writing an app where I was planing to move all email delivering in one
controller. When I try to load this "Utility" controller in a function
from another controller. App::import fail to load Email component in
this controller

Controller 1:

function send_message() {
...
App::import('Controller', 'Main');
$main = new MainController;
$main->simplemail($to, $subject, $body);
}


Utility controller:

class MainController extends AppController {

var $name = 'Main';
var $components = array('Email');
var $uses = null;
...
function simplemail($to, $subject, $body) {
$mail_settings = Configure::read('Mail');
$this->Email->from= $mail_settings['from_name'] . ' <' .
$mail_settings['from_mail'] . '>';
$this->Email->to  = $to;
$this->Email->subject = $subject;
debug($this->Email);
//$this->Email->send($body);

}





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Nested Associations / Multiple Joins

2009-01-16 Thread gerhardsletten

"User" is a subclass of model. Model::read api here:
http://api.cakephp.org/class_model.html

Think u need to set the model recursive attribute:

$this->User->recursive = 2;
$user = $this->User->read(null, $id);
debug($user);

http://book.cakephp.org/view/439/recursive

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: renaming problem

2009-01-16 Thread gerhardsletten

And did u remember to delete the files in app/tmp/cache
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



SmartMarkUp with CakePHP

2008-12-18 Thread gerhardsletten

Just added SmartMarkUp to my CakePHP blog. Its very lightweight and
works well with Cakes naming convention. Info here:
http://www.gersh.no/posts/view/smartmarkup_with_cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: how to use self join in cake

2008-07-19 Thread gerhardsletten

Thanks, this what I was looking for.

Works nice with


var $actsAs = array('Tree');


to
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: more fields in list function

2008-02-12 Thread gerhardsletten

Anyone who knows why your Favorites doesn't get stored in your
Favorites-link at the top? Can't delicious everything..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp tree behavior + ext js (drag and drop)

2008-02-12 Thread gerhardsletten

Hi Adam

Will have a look at it soon. Is working with a model with tree-
behavior right now.

Gerhard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: saveAll with multiple records, {$model}_id is missing

2008-02-09 Thread gerhardsletten

I work with a similar thing right now.

The edit view:

create('Contentclass');?>


input('id');
echo $form->input('title');
echo $form->input('attribute_identifier');
echo $form->input('is_container');
echo $form->input('contentclassgroup_id');
?>

data['ContentclassAttribute'])): ?>


data['ContentclassAttribute'] as
$att): ?>


input("ContentclassAttribute.{$n}.id", 
array('value'=>
$att['id']));
echo $form->input("ContentclassAttribute.{$n}.title",
array('value'=>$att['title']));
echo 
$form->input("ContentclassAttribute.{$n}.placement",
array('value'=>$att['placement']));
echo 
$form->input("ContentclassAttribute.{$n}.is_required",
array('value'=>$att['is_required']));
echo 
$form->input("ContentclassAttribute.{$n}.is_searchable",
array('value'=>$att['is_searchable']));
echo 
$form->hidden("ContentclassAttribute.{$n}.attribute_type",
array('value'=>$att['attribute_type']));
echo $html->link(__('Remove this attribute', true),
array('action'=>'removeAttribute', $form->value('Contentclass.id'),
$att['id']), null, sprintf(__('Are you sure you want to remove this
attribute with title %s?', true), $att['title']));
$n++;
?>




end('Save');?>
create(null, array('action' => 'addattribute'));?>


select("ContentclassAttribute.attribute_type",
$attribute_types, null, null, ""); ?>
end('Add new attribute');?>



And the controller:

function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Contentclass', 
true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Contentclass->saveAll($this->data)) {
$this->Session->setFlash(__('The Contentclass 
has been saved',
true));
} else {
$this->Session->setFlash(__('The Contentclass 
could not be saved.
Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Contentclass->read(null, $id);
}
$contentclassgroups = $this->Contentclass->Contentclassgroup-
>find('list');
$this->set('attribute_types', $this->Contentclass-
>ContentclassAttribute->getAttributeTypes());
$this->set(compact('contentclassgroups'));
}

Hope this helps!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug in $model->saveAll in 1.2

2008-02-07 Thread gerhardsletten

Hi FL1

Where do i find the 6337 release?
And I can't see any //return true; in the model.php saveAll function
on line 1349.

BTW: Rgarg thanks for the tip!

Gerhard

On Feb 6, 3:49 pm, FL1 <[EMAIL PROTECTED]> wrote:
> It's not returning true on success because the "return true;" was left
> out in the beta release. You can either grab any release after 6337
> (beta was 6311) or go into cake's model.php and add the return at the
> end of  the saveAll function and it should work like a dream.
>
> On Feb 5, 5:07 pm, gerhardsletten <[EMAIL PROTECTED]> wrote:
>
> > I am trying to save related models with saveAll, but it will not
> > return true even if it succeed to save:
>
> > if($this->Contentclass->ContentclassAttribute->saveAll($this->data['Content 
> > classAttribute'])) {
>
> >    $this->Session->setFlash(__('The Contentclass and all attributes
> > has been saved', true));
> >   $this->redirect(array('action'=>'edit', $id));} else {
>
> >   $this->Session->setFlash(__('The Contentclass was saved but the
> > attributes faild to saved', true));
>
> > }
>
> > In the api it says True on success, or an array of validation errors
> > on failure public.
>
> > Is this a bug?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Bug in $model->saveAll in 1.2

2008-02-05 Thread gerhardsletten

I am trying to save related models with saveAll, but it will not
return true even if it succeed to save:

if($this->Contentclass->ContentclassAttribute->saveAll($this-
>data['ContentclassAttribute'])) {
   $this->Session->setFlash(__('The Contentclass and all attributes
has been saved', true));
  $this->redirect(array('action'=>'edit', $id));
} else {
  $this->Session->setFlash(__('The Contentclass was saved but the
attributes faild to saved', true));
}

In the api it says True on success, or an array of validation errors
on failure public.

Is this a bug?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: WYSIWYG + source code formatting

2008-02-01 Thread gerhardsletten

When you post some code this is what happens:

1. You write your text and paste code into tinymce editor
2. Tinymce encode < and > to < and >
3. You save your post, and < and > get stored in the db
4. Problem: when you re-edit your post, the textarea which tinymce
reads the content from translate < and > back to < and >
5. Solution: double escape < and > to < and '>
before reading date from db into form.

Use this line in you controller:
$this->data['Post']['body'] = preg_replace(array('/\/
i'), array('<', '>'), $this->data['Post']['body']);

BTW this is my config of tinymce:

link('tiny_mce/tiny_mce'); ?>

tinyMCE.init({
theme : "advanced",
mode: "exact",
elements : "data[Post][body]",
relative_urls : false,
extended_valid_elements : "iframe[src|width|height|name|align|
frameborder]",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
entity_encoding : "named",
add_unload_trigger : false,
convert_urls : false,
content_css : "base; ?>/css/core.css?" + new
Date().getTime(),
preformatted : true,
apply_source_formatting : true,
cleanup : false,
verify_html : false
});


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Installing CakePHP on MAMP

2008-01-25 Thread gerhardsletten

If you install in in your own homedirectory /Users/name/Sites check
you httpd prefs for this folder, you find it in /private/etc/apache2/
users/. If not present create it. In mine I have this:



#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options",
"FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all


In my Sites folder I have installed cake in a subfolder, so the ~gersh/
cake2/.htaccess lokes like this:


   RewriteEngine on
RewriteBase /~gersh/cake2/
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


~gersh/cake2/app/.htaccess:


RewriteEngine on
RewriteBase /~gersh/cake2/
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

~gersh/cake2/app/webroot/.htaccess:


RewriteEngine On
RewriteBase /~gersh/cake2/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


Hope this helps!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to implement "Export to CSV" link in cake-php

2008-01-25 Thread gerhardsletten

If you want to automaticly download the cvs file, you have to create
the function in you controller that uses an own layout, where you set
the php headers to download or something.

Google "headers download php" and you should find!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Taking advantage of Cake to build personal book database

2007-11-10 Thread gerhardsletten

Do you mean that they should be allowed to

I think that each book object should b

Shouldn't the ISBN number be unique key. Books may have the same
title, but the ISBN is always unique, i think.. Don't know what
happens if the book is republished though..

Freebase do have a collection of book items. Think you get results in
json from them


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



UPPERCASE and lowercase affect CakePHPs way of parse Mysql queries!

2007-11-10 Thread gerhardsletten

Hi bakes!

Just upgraded to cake_1.1.18.5850 and some of my old distinct queries
failed.

Old query:
$posts = $this->findAll('Post.tag NOT LIKE ""', array('distinct
`Post`.`tag`'), 'Post.tag DESC');

Result query from Cake was:
Query: SELECT distinct `Post.`tag` FROM `cake_posts` AS `Post` LEFT
JOIN `cake_users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE
`Post`.`deleted` != 1 and `Post`.`tag` NOT LIKE "" ORDER BY
`Post`.`tag` DESC

As you can see the `Post.`tag` is parsed wrong..

But when i changed distinct to UPPERCASE it renders right:

New query:
$posts = $this->findAll('Post.tag NOT LIKE ""', array('DISTINCT
`Post`.`tag`'), 'Post.tag DESC');

Guess its nice to know ;-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple same fields in one view

2007-10-16 Thread gerhardsletten

Hi Lemon

I used a method in a project of mine, where I was updating a slug
field through ajax. Then I created a extra view for in the model,
which was included inside the  with a ajax updater. Then the
value of the field was an url-friendly verison of a title field. The
value of the title field was passed as in the $options array of
AjaxHelper::observeField

http://api.cakephp.org/class_ajax_helper.html#9fbc7425eafefd3e2745c8ff2c228a6a

Best regards Gerhard Sletten

On Oct 15, 1:22 pm, lemon <[EMAIL PROTECTED]> wrote:
> Hi :)
>
>   I've got question. How I can add fields on the fly and read data
> from them? For example: I have simple form with two selects. But
> bellow them is a link and when I click it, it should appear another
> pair of this two selects. Any ideas ? :)
>
> TIA
>
> Regards
> lemon
>
> P.S. Sorry for my lossy English.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Mac install using MAMP get MYSQL can't connect error

2007-07-22 Thread gerhardsletten

Hi Road runner!

This is parts of my database.php:

var $default = array('driver' => 'mysql',
'connect' => 
'mysql_connect',
'host' => 
'localhost',
'login' => 
'root',
'password' => 
'password',
'database' => 
'cakephp2',
'prefix' => 
'cake_');

Are u able to connect to mysql with regular php scripts?

Gerhard

On Jul 21, 5:31 pm, road runner <[EMAIL PROTECTED]> wrote:
> Hi, installing latest version of Cake on Mac OS 10.3.9
> Using MAMP but when I access the following page is returned properly
> but with message Can't connect see below.
>
> CakePHP Rapid Development
> Your database configuration file is present.
>
> Warning: mysql_connect() [function.mysql-connect]: Can't connect to
> local MySQL server through socket '8889' (2) in /Applications/MAMP/
> htdocs/cake/cake/libs/model/dbo/dbo_mysql.php on line 100
>
> Warning: mysql_select_db(): supplied argument is not a valid MySQL-
> Link resource in /Applications/MAMP/htdocs/cake/cake/libs/model/dbo/
> dbo_mysql.php on line 105
> Cake is not able to connect to the database.
>
> According to MAMP need to use port 8889 which I changed in the
> dbo_mysql.php file and again in the database.php file also changed
> sign in and password to what MAMP expects and created database cAlled
> cake. I used  phpmyadmin to create a database  cake without tables.
>
> If someone can point me in right direction would be appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Elements vs requestAction

2007-05-10 Thread gerhardsletten

Hi Tane

Is it possible to cache an spesific element in 1.1 or is it a new
function in 1.2? Can you give us an example?

On May 9, 4:00 am, "Tane Piper" <[EMAIL PROTECTED]>
wrote:
> I actually like to mix the two.  What I find best is to create an
> element, and put the rA() inside it.  Then I can use element caching
> to speeding things up, and reduce the load.
>
> Of course, you may find that when you update data on your site, these
> elements don't update right away - what you need to do is in your
> model, in the afterSave method is to use the PHP function unlink() and
> delete the cached element.
>
> Tane
>
> On 5/8/07, buzznut <[EMAIL PROTECTED]> wrote:
>
>
>
> > As I have been working on my app, I find myself using elements quite
> > often. I am wondering what the advantage/disadvantage is to just using
> > a $this->requestAction call in a view and using the normal view file
> > associated with the action instead of creating an element.
>
> > Thanks for any comments or feedback.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to: subpages in pages (pages_controller)

2007-04-23 Thread gerhardsletten

Thanks, looking forward to try it out..

Gerhard

On Apr 23, 2:10 pm, jitka <[EMAIL PROTECTED]> wrote:
> yes, You can create subfolders in app/views/pages, so url
>
> example.com/pages/projects/software_1
>
> will look for file
>
> app/views/pages/projects/software_1.thtml
>
> If You want example.com/pages/projects then create file
> app/views/pages/projects.thtml


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to: subpages in pages (pages_controller)

2007-04-23 Thread gerhardsletten

Lets say I want to create a pages called "Projects" with "Software 1"
and "Software 2" as subpages. How do I do that.

Do I create an folder within Pages folder, where an index.thtml file
will be the default access when http://www.example.com/pages/projects
is requested?

I want the 2 subpages at this url:
www.example.com/pages/projects/software_1
www.example.com/pages/projects/software_2


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---