Re: Modules?

2007-10-11 Thread savagekabbage

You can consider plugins to be modules of CakePHP as they are built to
be able to integrate with any Cake installation.

On Oct 11, 7:39 am, stefanb <[EMAIL PROTECTED]> wrote:
> So a plugin is not the same as a module? Now I'm confused.
>
> On Oct 11, 12:43 pm, dardosordi <[EMAIL PROTECTED]> wrote:
>
> > Though the first half is the correct one.
>
> > On Oct 10, 10:24 am, stefanb <[EMAIL PROTECTED]> wrote:
>
> > > Thank you for the second half of your reply. The first half didn't
> > > help me at all.
>
> > > On Oct 10, 3:12 pm, "Christian Winther" <[EMAIL PROTECTED]> wrote:
>
> > > > Did you even bother to look in the manual or the group ?
>
> > > > Its called plugins in cake
>
> > > > -Original Message-
> > > > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
> > > > stefanb
> > > > Sent: 10. oktober 2007 10:36
> > > > To: Cake PHP
> > > > Subject: Modules?
>
> > > > Does Cake support the use of modules?
>
> > > >www.example.com/module/controller/action/var1/val1/var2/val2


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



1.2 Localization Question

2007-09-17 Thread savagekabbage

Hey Guys,

I was wondering if 1.2 supported .PO files on a per/plugin basis.  I
have an app I'm going to be distributing with many plugins, and it
would be nice if I could separate language files just among the
plugins that need them.

Ideally I would like to be able to place the .PO files in the app/
locale/eng/LC_MESSAGES/ folder and a app/plugins/foo/locale/eng/
LC_MESSAGES/ folder.  Then language definitions inside of the foo
plugin would be available for any action inside of the plugin.

Is this possible? Thanks.


--~--~-~--~~~---~--~~
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: 1.2 Localization Question

2007-09-17 Thread savagekabbage

After some searching I found an enhancement ticket here:
https://trac.cakephp.org/ticket/1855

Anyone know how to achieve this in the meantime?



On Sep 17, 4:34 pm, savagekabbage <[EMAIL PROTECTED]> wrote:
> Hey Guys,
>
> I was wondering if 1.2 supported .PO files on a per/plugin basis.  I
> have an app I'm going to be distributing with many plugins, and it
> would be nice if I could separate language files just among the
> plugins that need them.
>
> Ideally I would like to be able to place the .PO files in the app/
> locale/eng/LC_MESSAGES/ folder and a app/plugins/foo/locale/eng/
> LC_MESSAGES/ folder.  Then language definitions inside of the foo
> plugin would be available for any action inside of the plugin.
>
> Is this possible? Thanks.


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



Discussion on cake-apps-sites-in-the-wild

2007-09-17 Thread savagekabbage

Added Selling Made Simple, an e-Commerce platform to the list.  It's
still in alpha, but feel free to check it out.


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



Seeking eCommerce Module Developers

2007-08-16 Thread savagekabbage

I'm in the process of creating an API for Selling Made Simple for
modules (plugins).  I'm looking for both developers of modules, and
people to request eCommerce modules.  If you guys could tell me what
functionality would be nice in module development, I could start
creating a basic API within Cake for the plugins to use.

Once a module is installed the application will make a call to the
module with requestAction, calling the Action Controller.  The results
of this call will be displayed within the current page template.
Order, and page content information will be available to the plugin.

Right now SMS modules will contain three controllers.

-Setup Controller
This controller will have two, possible three functions.  Install,
uninstall, and upgrade.  These functions will modify the database and
make any necessary changes.

-Admin Controller
In charge of the administration area.

-Action Controller
Methods for the front end.


A few modules I'm currently thinking about:
-Live Ajax powered chat
-Contact Form
-Reviews
-Featured Products
-Tiered Pricing


Thoughts?


--~--~-~--~~~---~--~~
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 I created a global record search

2007-08-11 Thread savagekabbage

I wanted to incorporate a simple Global Record Search into my cart
(Selling Made Simple), and this is how I did it if anyone's wondering.
This example will basically allow you to search any model by any any
field depending on what you put in the database.

This code is from Selling Made Simple and is released under the GPL.
If you see something that could be better about this code, please let
me know!

1 - Create a new model and database table, something like this is what
I used:

CREATE TABLE `search_tables` (
  `id` int(10) NOT NULL auto_increment,
  `model` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `url` varchar(50) NOT NULL,
  `edit_field` varchar(50) NOT NULL,
  `alternate_anchor` varchar(50) NOT NULL,
  PRIMARY KEY  (`id`)
)


2 - Create a basic form that will post to your controller.  Mine looks
something like this:

echo $form->create('Search', array('action' => '/search/
admin_global_search/', 'url' => '/search/admin_global_search/'));
echo $form->input('Search/term');
echo $form->submit();
echo $form->end();


3 - My controller looks something like this:

function admin_global_search ()
{
$search_tables = $this->Search->findAll();
$search_results = array();

foreach($search_tables AS $key => $table)
{
$search_results[$key] = array();
loadModel($table['Search']['model']);
$this->SearchModel =& new $table['Search']['model']();

$search_conditions = $table['Search']['model'] . '.' .
$table['Search']['field'] . ' LIKE \'%' . $this->data['Search']
['term'] . '%\'';

$search_results[$key] = $this->SearchModel-
>findAll($search_conditions,null,null,20);
}

$this->set('tables',$search_tables);
$this->set('results',$search_results);

$this->render('','admin');
}

4 - The view would of course just loop through the records and display
the data.  I won't bother posting that here, since that's probably
dependent on your application and need.

5- Add models to search to your database.  For example Selling Made
Simple has something like this:

INSERT INTO `search_tables` (`id`, `model`, `field`, `url`,
`edit_field`, `alternate_anchor`) VALUES
(1, 'Content', 'alias', '/contents/admin_edit/', 'id', ''),
(2, 'Content', 'head_data', '/contents/admin_edit/', 'content_id',
''),
(3, 'ContentDescription', 'name', '/contents/admin_edit/',
'content_id', ''),
(4, 'ContentDescription', 'description', '/contents/admin_edit/',
'content_id', 'name'),
(5, 'ContentLink', 'url', '/contents/admin_edit/', 'content_id', ''),
(6, 'Language', 'name', '/languages/admin_edit/', 'id', '');

-
Kevin Grandon
sellingmadesimple.org


--~--~-~--~~~---~--~~
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: Announcing Selling Made Simple - Open Source e-Commerce

2007-07-27 Thread savagekabbage

Basically what happens is you have a hierarchial content system.
Unlimited subcategories, and products under these subcategories.  When
you create/edit a product you will specify a price, name, and
description.  (A name and description for each language if you have
more than one turned on).

In your product template you can decide how to layout the price,
description, and product images.  All products have the field
template_id, so it is possible to in fact have multiple product
templates.  Not all sites will require this functionality, but it will
definitely be handy for some.

On Jul 27, 9:44 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 7/27/07, savagekabbage <[EMAIL PROTECTED]> wrote:
>
>
>
> > The reason I wanted to go with database storage instead of flat file
> > is because of the user who may want to have 20 different product
> > templates for a large site.  This just seemed easier to handle if the
> > templates were stored in the database.
>
> I think you are mixing product details with templates here... or am i
> missing something
>
> T
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =


--~--~-~--~~~---~--~~
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: Announcing Selling Made Simple - Open Source e-Commerce

2007-07-27 Thread savagekabbage

Hey guys, thanks for the feedback!

I'm still not 100% sure i"m going to go database stored templates.
Consider this:

Right now there are three main 'content types':
 - Static Pages
 - Category Views
 - Product Views

This means there will be a minimum of 4 templates if you include one
for the outer 'shell' of the site.

The reason I wanted to go with database storage instead of flat file
is because of the user who may want to have 20 different product
templates for a large site.  This just seemed easier to handle if the
templates were stored in the database.

Speed shouldn't really be an issue as long as the templates area
caching correctly.  But yes, Dr. Tarique Sani, it will definitely make
things more complicated.


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



Announcing Selling Made Simple - Open Source e-Commerce

2007-07-26 Thread savagekabbage

This post is to announce a new CakePHP project, Selling Made Simple.
Selling Made Simple (SMS) will be a fully functional, open source, e-
commerce application.  The main goal of the application is to be as
simple to use as possible, while being highly extensible.

But what about BakeSale?  Why not just modify that instead?
I'm taking a whole new approach towards SMS.  I believe that there's
nothing wrong with a cart having tons of features, as long as they are
cleanly integrated.  I also wanted to start off coding this using 1.2
instead of 1.1.

SMS's main audience will not necessarily be CakePHP developers as all
of the templates will be database stored.  However, CakePHP developers
should be able to easily write plugins for the system once it's
completed.  Our main audience is the average store owner who might not
know Cake, or PHP.  Modules & Code Contributions will not require
changes of core application files.

An alpha version should be released mid August, but you can feel free
to download the SVN version until then.

Find more information at our website: http://sellingmadesimple.org


--~--~-~--~~~---~--~~
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: Announcing: Webrocket

2007-04-14 Thread savagekabbage

Looks pretty cool so far... but it definitely needs a lot of work.
First fix the layout up some and I'll give you more suggestions.
Several of the buttons overlap and are unsightly in firefox.  I'm not
quite sure what that big box to the right is either, something about a
media player.  Good job so far, it will probably need a lot more work
to be a usable CMS however.

On Apr 14, 9:13 pm, "digital spaghetti"
<[EMAIL PROTECTED]> wrote:
> Just to quickly mention, the project is now hosted at the cakeforge:
>
> http://cakeforge.org/projects/webrocket/
>
> I've also updated the demo a thttp://66.160.135.85.  The demo
> username is WebrocketAdmin and password rocket.
>
> Tane
>
> On 4/14/07, digital spaghetti <[EMAIL PROTECTED]> wrote:
>
> > I'm pleased to announce the first official alpha of Webrocket - a CMS
> > built on CakePHP.
>
> > This release is *very* alpha.  It runs fine on my local install, but
> > even I had problems setting up on the test server, and it's still not
> > complete.
>
> > You can check out the demo athttp://66.160.135.85.  The server seems
> > to forward tohttp://66.160.135.85/xampp- and I can't seem to find
> > the alias to switch it off (so if anyone can help).
>
> > It's SVN is hosted on Google Code -http://code.google.com/p/webrocket/
> > Please feel free to download and prod and poke at it.  If anyone would
> > like to see features, please submit them at the google page under
> > issues, please also raise any bug reports.
>
> > The CMS is built on CakePHP, and uses jQuery for it's AJAX.
> > Currently, not all functions are using AJAX, and some don't seem to
> > work on the test server yet, but this is due to the /xampp issue.
> > Once thats fixed, it would be working.
>
> > There is no documentation yet, but i'll try update the Wiki soon.
>
> > Tane Piper
> >http://webrocket.wordpress.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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: creating static links to documents

2007-04-14 Thread savagekabbage

Does it work for you if you try something like:

echo $html->link('File','http://host.com/files/quickguide.pdf');


On Apr 14, 8:33 pm, "jyrgen" <[EMAIL PROTECTED]> wrote:
> i've got index.php in *all* URLs... :-)
> they all look likehttp://localhost/cake/index.php/controller/action
>
> don't quite know, what you mean with server setup.
> directory structure is
>
> /var/www/cake
> /var/www/cake/cake
> /var/www/cake/app
> /var/www/cake/app/controller
> /var/www/cake/app/views
> ...
> /var/www/cake/docs
>
> --
>
> bootstrap.php:
>
> ...
> if(env("HTTP_HOST") == "admin.localhost"){
>
> $_GET["url"] = "admin" . $_GET["url"];
>
> }
>
> elseif(strpos($_GET["url"], "admin") === 0){
>
> header ("HTTP/1.0 404 Not Found");
> die();
> }
> ...
>
> --
>
> active routes are:
>
> $Route->connect('/', array('controller' => 'users', 'action' =>
> 'login'));
> $Route->connect('/pages/*', array('controller' => 'pages', 'action' =>
> 'display'));
> $Route->connect ('/admin', array('controller' => 'users', 'action' =>
> 'login', 'admin' => 1));
>
> --
>
> /var/www/cake/index.php:
>
> define('APP_DIR', 'app');
> define('DS', DIRECTORY_SEPARATOR);
> define('ROOT', dirname(__FILE__)); // this dir !
> define('WEBROOT_DIR', 'webroot');
> define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS); //
> app-dir / webroot
>
> --
>
> /var/www/cake/app/index.php:
>
> require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
> (unchanged, like /var/www/cake/app/webroot/index.php)
>
> --
>
> best, jyrgen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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: Session question.

2007-04-14 Thread savagekabbage

A thtml file is a view, not a controller =)

On Apr 14, 7:59 pm, "peterhf" <[EMAIL PROTECTED]> wrote:
> I have created a thtml file and placed it in the /pages/ directory. In
> the file I have "if ($this->Session->check('function')) ...". The
> following error message appears: "Fatal error: Call to a member
> function on a non-object in ..." which points to the line containing
> the "...Session->check".
>
> I thought that the Session Component was available to every Cake
> controller including the PagesController.
>
> Where have I gone wrong?
>
> Peter -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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: SELECT LAST_INSERT_ID() and COUNT(id)

2007-04-14 Thread savagekabbage

Actually disregard my last message, I misread your post.  I'm not sure
if there's a way to avoid doing this without hacking the source
though.  If you're worried about one extra query per page then the
Cake framework probably isn't for you.

On Apr 14, 9:05 am, "majna" <[EMAIL PROTECTED]> wrote:
> There is two additional query after creating new record:SELECT
> LAST_INSERT_ID() AS insertID
>
> and two after update: COUNT(id)
>
> How to avoid this behavior? Why is it there?
> CAKE 1.1.14,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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: SELECT LAST_INSERT_ID() and COUNT(id)

2007-04-14 Thread savagekabbage

In your controller you can use:

$this->Model->getLastInsertId(); to get the last inserted id.

and

$this->Model->findCount(); to get the count


These are both found in the manual, and also here:
http://www.cakewiki.com/index.php?title=getLastInsertId
http://www.cakewiki.com/index.php?title=findCount

-Savage

On Apr 14, 9:05 am, "majna" <[EMAIL PROTECTED]> wrote:
> There is two additional query after creating new record:SELECT
> LAST_INSERT_ID() AS insertID
>
> and two after update: COUNT(id)
>
> How to avoid this behavior? Why is it there?
> CAKE 1.1.14,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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: View this page "multiModel component"

2007-04-14 Thread savagekabbage

I'm curious to see how it worked at least, but looks like the page was
taken down.  Could you repost it?



On Apr 14, 6:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Rather than continue waiting for my bakery article to be approved,
> I've added a page to the google group with a component I've been
> using.  Here's a brief intro:
>
> The standard Model->find() functions return multiple rows of data in a
> format that works fine for displaying the data in your views using a
> for each loop:
>
> Cars->find()
>   Results:
> [data]
>[Cars]
>   [0]
>   make => Ford
>   model => Pinto
>   [1]
>   make => Nissan
>   model => 200SX
>
> But what if you want to allow those fields to be updated in a form and
> sent back to the controller for an edit or add action?
>
> This Component (and it's sister Helper) make this an easy task.
>
> Click onhttp://groups.google.com/group/cake-php/web/multimodel-component
> - or copy & paste it into your browser's address bar if that doesn't
> work.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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: Creating a support wiki for CakePHP, any interest?

2007-04-12 Thread savagekabbage

Yes, that's exactly why it was taken down. However, while CakePHP has
a lot of documentation on the web, the API, and the forums... Most of
it is too hard to grasp or too steep for newbies to handle.  There are
countless newbies who have/have had trouble learning the framework
(including myself) and I believe this will be a good resource for
future CakePHP prospects.

I don't see how a wiki can be any less organized or correct than a
Google group, so I'm going to move forward with this.


On Apr 12, 4:52 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 4/12/07, savagekabbage <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm going to attempt to create user-friendly documentation for
> > developers who are new to CakePHP.  I think a resource like this would
> > be a great help for new developers, and it's a shame they took down
> > the old wiki.
>
> If I remember correctly, the wiki was taken down because it was full
> of junk, and a lot of incorrect junk at that.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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
-~--~~~~--~~--~--~---



Creating a support wiki for CakePHP, any interest?

2007-04-12 Thread savagekabbage

I'm going to attempt to create user-friendly documentation for
developers who are new to CakePHP.  I think a resource like this would
be a great help for new developers, and it's a shame they took down
the old wiki.

If you'd like to help out, feel free to stop by the site and publish
something =)  Anonymous changes are currently allowed as there's no
real content there yet.

I'm new to wiki publishing myself so this will be a learning
experience for me as well.

http://www.cakewiki.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
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
-~--~~~~--~~--~--~---



Discussion on cake-apps-sites-in-the-wild

2007-04-05 Thread savagekabbage

I have created a new interactive site almost emulating a flash
enviroment.  Please let me know what you think, visit: www.letterwars.com


--~--~-~--~~~---~--~~
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: Object creation debugging

2007-04-01 Thread savagekabbage

That query doesn't look too complex... Why are you doing it in a
custom query instead of just doing it in a $this->Order->save() ?

Have you tried getting the insert id by doing: $this->Order-
>getLastInsertId(); in the controller after your query call?  Does it
actually insert the information into the database?


-Savage

On Apr 1, 10:11 pm, "Strings28" <[EMAIL PROTECTED]> wrote:
> I'm trying to create a new model object and it is failing (accoring to
> my if statements: see below for code samples).  What's the best way to
> debug why this is failing?
>
> table schema
>
> Create table 'orders' (
> id int(11) NOT NULL auto_increment,
> 'user_id' int(11) NOT NULL,
> 'order_date' datetime NOT NULL,
> 'order_state' enum('new', 'open', 'delivery', 'closed') NOT NULL,
> 'delivery_date' datetime NOT NULL,
> 'comments' blob NOT NULL,
> PRIMARY KEY ('id')
> )
>
> The code that is trying to create the object looks like this:
> $id = $this->Order->createOrder();
> $this->Session->write('OrderID', $id);
> $this->log("the order id was created: {$id}");
>
> The create order part of the model looks like this:
> function createOrder()
> {
> $ret = $this->query("INSERT INTO Orders (id, user_id-, order_date,
> order_state) values (0, [code that inserts session], "[date()]",
> 'new')");
> $order_id = mysql_insert_id();
> return $order_id;
>
> }
>
> However, what gets logged is 'error: 0'
>
> Any help is appreciated.
>
> Regards,
> Randy Peterman


--~--~-~--~~~---~--~~
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: Edit problem

2007-03-30 Thread savagekabbage

Did you try to throw a few pr()'s in the controller before the save to
see what the values were set at?

On Mar 30, 9:47 am, "christianandradet" <[EMAIL PROTECTED]>
wrote:
> Iam trying to edit a Cliente an i have this in my model 'Cliente':
>  var $name = 'Cliente';
>
>  var $hasOne = array('Naturale' => array('className'=>
> 'Naturale',
>   'conditions'   => '',
>   'order'=> '',
>   'dependent'=>
> true,
>   'foreignKey'   =>
> 'CLI_ID'
> )
>   );
>
> when i try to save(update) an insert statement is created and an error
> of duplicate entry is shown.
> But i need to edit i do not know why this is happening, i tested it
> with a simplier model and it works fine, please help!!
>
> function edit($id = null)
> {
>   if (empty($this->data['Cliente']))
>   {
>   $this->Cliente->id = $id;
>   $this->data = $this->Cliente->read();
>   }
>   else
>   {
>   $this->data['Naturale']['CLI_ID'] = $this->data['Cliente']
> ['ID'];
>   if($this->Cliente->Naturale->save($this->data['Naturale']))
>   if($this->Cliente->save($this->data['Cliente']))
>   {
> $this->flash('El cliente fue modificado.','/
> Clientes/');
>   }
>   }}


--~--~-~--~~~---~--~~
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: Link / URL Best Practices

2007-03-30 Thread savagekabbage

The whole point of Cake is for rapid application development.  You
shouldn't modify your PHP/logic programming in order for it to change
the way it outputs the HTML if it's just going to work the same..  I
personally would prefer 1 line of code to 7 lines =)

On Mar 30, 10:54 am, "rtconner" <[EMAIL PROTECTED]> wrote:
> Nate, hey cool thanks. Though when I tried it out
>
> css(array("reset", "fonts", "base", "layout", "nav"),
> "import"); ?>
> Produced
> @import url(/tire/thirstytire/css/reset.css); style>
>