Re: Page Not Found Error In cake_1.2.0.7296-rc2

2008-07-25 Thread Daniel Hofstetter

Hi Amit,

 I am new to cakePHP world that's why i try to started with the blog
 tutorial shown on cakephp.org.  But whenever i hit the browser 
 withhttp://localhost/cakeBlog/posts/index,
 i get an error Not Found. The requested URL /cakeBlog/posts/index was
 not found on this server..

 Here is what i made to get it worked

 1. first created the app/models/post.php
 = class Post extends AppModel
        {
                        var $name = Post;
        }
 2. Secondly, add controller in app/controllers/posts_controller.php
 = class PostsController extends AppController
        {
                $name = Posts;

                function index()
                {
                        $this-set(posts, $this-Post-findAll());
                }
        }

 3. Finally print the array assign to posts variable in controller
 page shown above in app/views/posts/index.ctp
 = print_r($posts);

 Now as it is exactly shown in the blog tutorial on cakephp.org, it
 should work.
 But its not. And i wasted lot of time to find out what went wrong.

 Please tell me, is there something wrong in this code?

No, the code looks fine. If you call localhost/cakeBlog, does the
shown page use any styles? If no, it is probably an issue with
mod_rewrite, see http://book.cakephp.org/view/333/a-note-on-mod_rewrite

Hope that helps!

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~-~--~~~---~--~~
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: how to find('all') with with many relations?

2008-07-25 Thread grigri

Try this:

$this-Plate-bindModel(array('belongsTo' = array(
  'CustomerX' = array(
'className' = 'Customer',
'foreignKey' = false,
'conditions' = 'CustomerX.id=User.customer_id',
'fields' = 'CustomerX.id'
  ),
  'DealerX' = array(
'className' = 'Dealer',
'foreignKey' = false,
'conditions' = 'DealerX.id=CustomerX.dealer_id',
'fields' = 'DealerX.id'
  )
)));

$this-Plate-find('all', array(
  'recursive' = 0,
  'conditions' = DealerX.type  'drug_dealer' // or whatever
));

The 'CustomerX' and 'DealerX' aliases just have to be different from
the actual name to avoid collisions.

I've been thinking about trying to put this in a behavior, but it's
difficult to extract model/field names from conditions arrays and
strings. If I find a good solution I'll post it.

hth
grigri

On Jul 24, 2:35 pm, Jon Hinson [EMAIL PROTECTED] wrote:
 I tried doing something along the lines of this:

 $this-Plate-find('all',
 array('contain'=array('User'=array('contain'=array('Customer'=array('Dealer'=array('conditions'=array('Dealer.id
 ='=$id;

 But, I'm afraid that did not work. It gets all of the Plates for that
 particular Dealer, and then it goes on to fetch ALL plates. It ran
 something like 140 queries (I had a lot of Plates) Surely there is a
 easy way to produce a SIMPLE query like this:

 SELECT *
 FROM plates p
 JOIN users u ON u.id = p.user_id
 JOIN customers c on c.id = u.customer_id
 JOIN dealers d on d.id = c.dealer_id
 WHERE d.id = $id;

 I'm wondering if they could build in to cake a way to just follow each
 belongsTo relationship, and for each one a join statement is added
 until x levels deep.

 something like this:

 $this-Plate-find('join', array('depth'=3,
 'conditions'=array('Dealer.id ='=$id)));

 So what this would do is look for a belongsTo relationship in Plate,
 and it would find User ( depth of 1) and add that join to the query.
 Then, it searches User for belongsTo and finds Customer (depth of 2)
 and adds the join, and finally it would look for the belongsTo in
 Customer and find Dealer (depth of 3) and add the join. It would then
 add the conditions to the where clause. There you have it, you'd be
 able to paginate the plates results. I would absolutely, positively be
 madly in love with this feature.

 Jon Hinson

 On Jul 23, 8:29 am, Marc [EMAIL PROTECTED] wrote:

  This still doesnt make any difference, also saw i had put not working
  code:

  $this-paginate = array(
                          'contain' = array(
                                          'User.Customer.Dealer' =
  array('id'=$id)
                          )
                  );

  had to be
  $this-paginate = array(
                          'contain' = array(
                                          'User.Customer.Dealer' =
  array('conditions' = array('id' = $id))
                          )
                  );

  But reset doesnt make any difference, still get themall.

  On 23 jul, 14:48, Amit Badkas [EMAIL PROTECTED] wrote:

   2008/7/23 Marc [EMAIL PROTECTED]:

Well, tried several options, im now working with RC2 and tried
Containable behaviour.

i now have the following code in my DealersController:

       function listPlates($id = null) {
       $this-Dealer-Behaviors-attach('Containable');
               $this-Dealer-recursive = -1;
               $this-paginate = array(
                       'contain' = array('Customer.User.Plate'),
                       'conditions' = array('Dealer.id' = $id)
               );
               $plates = $this-paginate('Dealer');
               pr($plates);
       }

I also tried in my PlatesController:

       function listPlatesByDealer($id = null) {
       $this-Plate-Behaviors-attach('Containable');
               $this-Plate-recursive = -1;
               $this-paginate = array(
                       'contain' = array(
                                       'User.Customer.Dealer' =
array('id'=$id)
                       )
               );
               $plates = $this-paginate('Plate');
               pr($plates);
       }

Still i dont know how i can get just the plates related to one dealer.

   - You also have to provide 'reset' = false in paginate array like

                  $this-paginate = array(
                          'contain' = array(
                                          'User.Customer.Dealer' =
   array('id'=$id)
                          ),
                          'reset' = false
                  );

   --
   Amit

  http://amitrb.wordpress.com/http://coppermine-gallery.net/http://chee...
--~--~-~--~~~---~--~~
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 

Re: cakephp on sourceforge.net

2008-07-25 Thread bycho

I was having the same error, and that error was caused because some
folders in tmp/cache were missing.

Instead of creating a link from /app/tmp/cache to /tmp/cache... have
to tried to configure the cache directly to point to that folder. It's
something like this:

 Cache::config('default', array('engine' = 'File' //[required]
'path' 
= '/tmp/cache', //[optional] use system tmp
directory - remember to use absolute path
)
);

And don't forget to include *all* the proper subfolders. That was the
problem I had and took me a while to discover.

Hope it works.

On 21 jul, 09:55, oana [EMAIL PROTECTED] wrote:
 No  one can help me with this one, i guess?

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



Loading a component with App::import() doesn't work

2008-07-25 Thread Andreas Hofmann

Hi all!

I'm using cake 1.2.0.7296 RC2 and was now rewriting my code.
When I try to import a component aith App::import, it seems not be
loaded/started up:

public function __construct()
{
  parent::__construct();
  App::import('component', 'Auth');
}

Results in:
Undefined property: GameController::$Auth

Even loading it directly in the action method or globally in the App-
Controller doesn't work.
Do you know this problem?

Greetings,

Andreas!

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



Paginate on Batch which hasMany Job which belongsTo Package

2008-07-25 Thread Rahul J

Hi Guys,

My problem here is performance. $this-Batch-paginate() runs just
fine, except when there are 100K Jobs.
I have tried unbinding and then binding Batch with hasOne Job, that
doesnt solve it either.
I need to go from Batch - Job - Package.

I'm using 1.2.0.6311 beta

Dire need of help.

Thanks!

--~--~-~--~~~---~--~~
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: Loading a component with App::import() doesn't work

2008-07-25 Thread Chris Hartjes

On Fri, Jul 25, 2008 at 3:54 AM, Andreas Hofmann
[EMAIL PROTECTED] wrote:

 Hi all!

 I'm using cake 1.2.0.7296 RC2 and was now rewriting my code.
 When I try to import a component aith App::import, it seems not be
 loaded/started up:

 public function __construct()
 {
  parent::__construct();
  App::import('component', 'Auth');
 }

 Results in:
 Undefined property: GameController::$Auth

Well, usually you load a component by setting the $components array

var $components = array('Auth');

What is it you are trying to do?

-- 
Chris Hartjes
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Cake PHP on OS X 10.5.4

2008-07-25 Thread ReiToei

Looks like it could be a problem with mod_rewrite? Check and see if
it's enabled in your Apache config. It's not a php problem anyway, you
can cross that off the list. Are you sure your .htaccess files (in
your app/ folder) copied across from your old machine? Drop into a
console and do an ls -als to see if they're there, as I don't think
you can see them from Finder. Also, just google enabling mod_rewrite
in Leopard.

(I use MAMP on my 10.5 system, by the way).

On Jul 25, 2:01 am, Tony Thomas [EMAIL PROTECTED] wrote:
 I just got Apache  MySQL running on my PowerBook running OS X 10.5.4.
 My installation of CakePHP 1.2 RC2 that worked in OS X 10.4 no longer
 works. When I access the site, I get the following error:

 Warning: require(webroot/index.php) [function.require]: failed to open
 stream: No such file or directory in /Users/home/folder/index.php on
 line 25

 Fatal error: require() [function.require]: Failed opening required
 'webroot/index.php' (include_path='.:') in /Users/home/folder/
 index.php on line 25

 Obviously webroot/index.php IS there. For some reason the application
 can't find it/access it. This may not be a CakePHP issue. It may be an
 issue with Apache or PHP settings, but I don't know where to start.

 Can someone point me in the right direction?

 PHP 5.2.5
 Apache 2.2.8

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



Create a new model instance and return its new ID

2008-07-25 Thread GrandiJoos

Hi,

I want to create a new model instance from a controller (linked to an
other model).
The data in the model can be populated by the method itself (user id)
etc.
Furthermore, the id of the just created model should be returned to
use as a foreign key in the current model.
How do I do this?

Sample code:
http://bin.cakephp.org/view/997858437

Please help this newbie :p

GrandiJoos

PS sorry if the information is sparse
--~--~-~--~~~---~--~~
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: session not getting inside my custom component

2008-07-25 Thread Web Test

it worked when i called session component inside my class like this



class MessageComponent extends Object
{
var $components = array('Session');
function getMessage()
{
}
}

Hoping that this will help some others who having the same problem.






On Jul 19, 9:49 am, Jonathan Snook [EMAIL PROTECTED] wrote:
 You have a couple ways to do so.

 1) use the startup method, which gets passed the controller as its
 first argument. Store a reference to it within the object.

 2) App::import('Component', 'Session'); and then you should be able to
 instantiate thesessionobject and use it that way.

 On Sat, Jul 19, 2008 at 12:45 AM, web [EMAIL PROTECTED] wrote:
  On Jul 18, 12:18 pm, web [EMAIL PROTECTED] wrote:
  Iam using cakephp1.2,  and  have created acustomcomponentfor
  messaging purpose . but amnotable to use $this-Session-read() or
  $this-Session-delete()insidemy class.
  These  codes creates an error like this Call to a member function on
  a non-object . So  I have to use the conventional phpsessioncodeinsidemy 
  componentfile.

  Can anyone tell me how to getSessionhelperinsidecomponent ?

  here ismycode
  ?php
  class MessageComponent extends Object
  {
          function getMessage()
          {
                  $message = '';

                  $msg = $this-Session-read('message');
                  $this-Session-delete('message');
                  if($msg != )
                  {
                          switch($msg)
                          {
                           $message= ...
                          }
                 }

  return $message;

  }
  }

  Thanks in advance .

--~--~-~--~~~---~--~~
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: $ajax-form('/cntr/action'...) problem RC2

2008-07-25 Thread Elmo

From the test case(s) for the $ajax-form() helper, the book was wrong
(or at least according to the latest RC2). The correct syntax is:
?php
// WRONG: $ajax-form('/notes/addquick', 'post',
array('update'='notes'));
// RIGHT: (Note: I still don't know what the 'showForm' is for)
echo $ajax-form('showForm', 'post',
array('model' = 'Note',
'url' = array('action'= 'addquick',
'controller' = 'notes'),
'update' = 'notes_div'));
?

--~--~-~--~~~---~--~~
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: Loading a component with App::import() doesn't work

2008-07-25 Thread Christian Winther

App::import !== ClassRegistry::init

App::import only loads the class, you need to initialize it by hand

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andreas 
Hofmann
Sent: 25. juli 2008 09:54
To: CakePHP
Subject: Loading a component with App::import() doesn't work


Hi all!

I'm using cake 1.2.0.7296 RC2 and was now rewriting my code.
When I try to import a component aith App::import, it seems not be
loaded/started up:

public function __construct()
{
  parent::__construct();
  App::import('component', 'Auth');
}

Results in:
Undefined property: GameController::$Auth

Even loading it directly in the action method or globally in the App-
Controller doesn't work.
Do you know this problem?

Greetings,

Andreas!



--~--~-~--~~~---~--~~
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: 30 second timeout occurring in app hosted at 1and1.com

2008-07-25 Thread BrendonKoz

Out of curiosity, are you setting the curl timeout?  By default, I
think it is 30 seconds.  Otherwise, the server configuration may be
set so that the TimeOut directive is set to 30 seconds.  There are a
few possible issues here, not necessarily just PHP alone.

On Jul 23, 11:04 pm, Brad C [EMAIL PROTECTED] wrote:
 The default value provided by 1and1 is 5. I am able to change it
 using the init_set(), and phpinfo() does report the modified values.
 I've changed the value and it doesn't have an effect on the 30 second
 timeout I'm experiencing.

 I'll contact 1and1 and hope they can provide some insight into this.
 If I can't adjust this timeout, I'll just modify the program to break
 up the screen scraping into separate invocations.

 On Jul 23, 5:45 pm, francky06l [EMAIL PROTECTED] wrote:



  Maybe your host does not allow you to change max_execution_time by
  ini_set or whatever..

  As a quick test, make a phpinfo() in a simple php file.
  Make another php with init_set('max_execution_time', 3600); phpinfo();
  check if the max_execution_time did change ..

  However, try to change to lower value, if the phpinfo() gives you a
  lower value you can try to call ini_set in your loop  with a lower
  value ...(since everytime init_set(max_execution_time..) is called, it
  resets the time script to 0 ) ... Just a hint, not sure about the
  result..
  hth.

  On Jul 23, 9:54 pm, clemos [EMAIL PROTECTED] wrote:

   Hi Brad

   On Wed, Jul 23, 2008 at 8:22 PM, Brad C [EMAIL PROTECTED] wrote:

I thought about both solutions you mentioned, but was hoping to just
adjust the timeout. The script wouldn't take much longer than 60
seconds, unless there are timeouts to the webpages.

None of the responses to my original post have mentioned specifically
which value I can adjust to increase this timeout. The
'max_execution_time' is set to 5. Are there any other timeout
values for PHP scripts ?

   I don't think there are other timeout values (though there are other
   limits like memory usage, etc)
   Did you change max_execution_time or is 5 the default value ?

I can override the PHP settings by using a php.ini file, or by calling
the ini_set() method in CakePHP before the framework is initialized.
But, none of those settings seemed to have an effect.

Is it possible that my hosting provider has capped this to 30 seconds
and won't allow me to override it ?

   Of course, it's possible; actually, it's like that on every shared
   host I've experienced so far.

   ++
   Clément

On Jul 23, 10:15 am, BrendonKoz [EMAIL PROTECTED] wrote:
Others have already stated the PHP setting issue.  As many hosting
providers limit access to that setting (for good reason), chances are
that even if you were to modify it to 60 seconds, since you're on a
shared host, it may take longer than you'd expect.  It'd be a better
idea to loop the script either after a set number of execution
seconds, or a set number of records.

What do you mean by 'loop'?
Track either program execution milliseconds within the script and use
a header() redirect (to the same page with some extra param query
info), or do the same thing but when tracking number of record
insertions.  You could save the scraped data to a temporary file, grab
the first 150-200 records, process those records, update the file
(removing those records), reload the page (using header()) and
continue processing until there are no more records in the file - then
delete the temporary file.

There are plenty of ways to get around this problem that are probably
more efficient for the server than increasing the PHP execution time
setting.

On Jul 22, 3:54 pm, Brad C [EMAIL PROTECTED] wrote:

 I have an app that screen scrapes a website and then inserts the data
 into a mysql database. For the main request that loads the database,
 there will be about 1100 inserts and another 1100 saves to existing
 records.

 I can run this load without problem when using xampp on my computer
 (it takes over 60 seconds). When I run the app at1and1.com, it always
 times out after 30 seconds. I have timed it with a watch, and it is
 always 30 seconds.

 The cake controller that performs the load echoes out data after each
 record is inserted. It inserts anywhere between 236 and 245 records 
 on
 each attempt, so it isn't a particular record causing the problem.

 I have turned up the cakephp debug setting to 3, but no SQL is output
 as the script terminates before cake can output any of the framework
 debug. I have set the PHP settings for 'display_errors', 
 'log_errors',
 and 'error_log', but no php error message is ever shown or logged. 
 The
 'max_execution_time' variable is set to 5. I have verified these
 settings by having my cake app display the phpinfo() data.

 The cake log 

how to read a individual entry of a database and display it on a html page ?

2008-07-25 Thread vickyk

is it possible to display individual row or columns from a database in
a html table ?
if yes,then how ?

--~--~-~--~~~---~--~~
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: strange problem -- Missing table

2008-07-25 Thread Jeroen van Wissen

I had the same problem.

But when i disable caching in the configuration file.
I get random 'Missing database table...for model' messages
everytime I run the tests.

What could cause this?
Is it that sometimes the test is done before the fixtures are loaded?
Because everytime I get a Missing database table error, I check the
database and the table is there!

Anyone?

Thnx!!
Jeroen

On 14 jul, 21:25, puneetratan [EMAIL PROTECTED] wrote:
 Hello

 In the config file of cake php , there is an option for Cake Cache
 true and false, and make it false, and then check

 Thanks
 Puneet

 On Jul 14, 3:18 pm, Bo ozz [EMAIL PROTECTED] wrote:



  Cake keeps showing me this error message:

  -
  Missing Database Table

  Error: Database table albums for model Album was not found.

  Notice: If you want to customize this error message, create app/views/
  errors/missing_table.ctp

  --

  Pretty self-explanatory you would say, but the table does exist!!

  I've tried troubleshooting this, but the following code in my model
  does show my records in that table:

  --
  ?php

  class Album extends AppModel {
          function Album() {
                  mysql_connect('localhost','***','***');
                  mysql_select_db('***');
                  $result = mysql_query('SELECT * FROM albums');
                  print_r(mysql_fetch_assoc($result));
                  die();
          }
      //var $name = 'Album';
          //var $hasMany = array('Foto');

  }

  ?

  

  Any thoughts??

  thanks!- Tekst uit oorspronkelijk bericht niet weergeven -

 - Tekst uit oorspronkelijk bericht weergeven -

--~--~-~--~~~---~--~~
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: $ajax-form('/cntr/action'...) problem RC2

2008-07-25 Thread Jon Hinson

I'm not 100% if this is the problem, but since you're creating the
form in /users/view, it's going to assume that you want to use the
users controller since you did not specify a different controller.
Again, I'm not 100% sure, but it might need to be something like this:

?=$ajax-form('Notes', 'post', array('update'='notes',
'action'='addquick'));?

Jon Hinson

On Jul 25, 9:49 am, Elmo [EMAIL PROTECTED] wrote:
 From the test case(s) for the $ajax-form() helper, the book was wrong
 (or at least according to the latest RC2). The correct syntax is:
 ?php
         // WRONG: $ajax-form('/notes/addquick', 'post',
 array('update'='notes'));
 // RIGHT: (Note: I still don't know what the 'showForm' is for)
         echo $ajax-form('showForm', 'post',
                 array('model' = 'Note',
                         'url' = array('action'= 'addquick',
 'controller' = 'notes'),
                         'update' = 'notes_div'));
 ?

--~--~-~--~~~---~--~~
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: Where to start?

2008-07-25 Thread Rich

I started with the blog tutorial then expanded by googling cakeph
auth or cakephp ajax. there is enough blogs and tuts to get you
started. You can get a grasp of the small stuff by just sitting down
and working with it. Every time you hit a snag, check out this group
or the irc channel (#cakephp on irc.freenode.net) or just google
it . . .i'm making leaps and bounds by just using the google!

On Jul 25, 9:35 am, sdustinh [EMAIL PROTECTED] wrote:
 I'm new to CakePHP. I've just finished reading over the documentation
 completely, I've been playing with the code, checked out the Bakery,
 and downloaded example code to play with. I still feel like I don't
 know what to do when I sit down to start a project. I'm converting
 over a project that is sewn together with some PHP, and when I start
 to set up my models and controls it seems like there is still a lot
 that I don't know about it.

 One of the big things about this project is I'm going to be using a
 lot of ajax (as opposed to none in its current state), and I'm not
 really sure where to start. How did you guys tackle your first Cake
 project? I keep hearing how easy it is to use, and I'm sure that it is
 (I've just started on this two days ago), but I'm just feeling a
 little overwhelmed about it. I usually do best with tutorials and
 visual examples, but I've not found too many on how to get started.

 Thanks for your suggestions!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Where to start?

2008-07-25 Thread sdustinh

I'm new to CakePHP. I've just finished reading over the documentation
completely, I've been playing with the code, checked out the Bakery,
and downloaded example code to play with. I still feel like I don't
know what to do when I sit down to start a project. I'm converting
over a project that is sewn together with some PHP, and when I start
to set up my models and controls it seems like there is still a lot
that I don't know about it.

One of the big things about this project is I'm going to be using a
lot of ajax (as opposed to none in its current state), and I'm not
really sure where to start. How did you guys tackle your first Cake
project? I keep hearing how easy it is to use, and I'm sure that it is
(I've just started on this two days ago), but I'm just feeling a
little overwhelmed about it. I usually do best with tutorials and
visual examples, but I've not found too many on how to get started.

Thanks for your suggestions!

--~--~-~--~~~---~--~~
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: Where to start?

2008-07-25 Thread Rich

Also, check out . . . CakePHP Application Development  by co-author
Ahsanul and Beginning CakePHP: From Novice to Professional by Apress

On Jul 25, 1:49 pm, Rich [EMAIL PROTECTED] wrote:
 I started with the blog tutorial then expanded by googling cakeph
 auth or cakephp ajax. there is enough blogs and tuts to get you
 started. You can get a grasp of the small stuff by just sitting down
 and working with it. Every time you hit a snag, check out this group
 or the irc channel (#cakephp on irc.freenode.net) or just google
 it . . .i'm making leaps and bounds by just using the google!

 On Jul 25, 9:35 am, sdustinh [EMAIL PROTECTED] wrote:

  I'm new to CakePHP. I've just finished reading over the documentation
  completely, I've been playing with the code, checked out the Bakery,
  and downloaded example code to play with. I still feel like I don't
  know what to do when I sit down to start a project. I'm converting
  over a project that is sewn together with some PHP, and when I start
  to set up my models and controls it seems like there is still a lot
  that I don't know about it.

  One of the big things about this project is I'm going to be using a
  lot of ajax (as opposed to none in its current state), and I'm not
  really sure where to start. How did you guys tackle your first Cake
  project? I keep hearing how easy it is to use, and I'm sure that it is
  (I've just started on this two days ago), but I'm just feeling a
  little overwhelmed about it. I usually do best with tutorials and
  visual examples, but I've not found too many on how to get started.

  Thanks for your suggestions!
--~--~-~--~~~---~--~~
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: how to read a individual entry of a database and display it on a html page ?

2008-07-25 Thread Rich

yes . . .check out  http://book.cakephp.org/view/73/retrieving-your-
data  to get you familiar with the syntax

the best way i figure out the code is to bake it and then check out
the views and controllers that were created . . .then you can expand
on those!

On Jul 25, 10:05 am, vickyk [EMAIL PROTECTED] wrote:
 is it possible to display individual row or columns from a database in
 a html table ?
 if yes,then how ?
--~--~-~--~~~---~--~~
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: Create a new model instance and return its new ID

2008-07-25 Thread Smelly_Eddie

GJ:

When users register on one site onf mine, i automatically add them to
a table of news articles. I think this is a similar idea top what you
(very) sparsley described.
this is calledc from users/register ,and calls a function in a
behavior, that User actsas. You could also place directly int he model
me thinks.

//get id of newly registered user
$lastId = $this-User-getLastInsertId();
//subscribe new user to internal news 
for all
project
$this-User-addToNews($lastId);

//behavior
function addtonews($userID){
$model-query('INSERT INTO `join_table` (`project_id`, `user_id`)
VALUES (\'1\', \''.$userID.'\')');



i think that should get yo going.

the api and manual have great expalnations of various methods
available to cake.

On Jul 25, 9:52 am, GrandiJoos [EMAIL PROTECTED] wrote:
 Hi,

 I want to create a new model instance from a controller (linked to an
 other model).
 The data in the model can be populated by the method itself (user id)
 etc.
 Furthermore, the id of the just created model should be returned to
 use as a foreign key in the current model.
 How do I do this?

 Sample code:http://bin.cakephp.org/view/997858437

 Please help this newbie :p

 GrandiJoos

 PS sorry if the information is sparse
--~--~-~--~~~---~--~~
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: problem with user input -

2008-07-25 Thread Smelly_Eddie

Not sure what your trying to do...

Are you trying to validate user input before saving new records?

Are you trying to format existing records in an edit?

Are you just trying to strip html tags from the post?

On Jul 25, 3:49 am, Web Test [EMAIL PROTECTED] wrote:
 i have a company adding form which contain 2 fields one for company
 name and other for the type .In the company name text box i tied to
 enter this input type=text name=txtname value=/

 This creates a text box in the company listing instead of  displaying
 the entered text.
 How can we apply the htmlentiies () function with posted data?

 Can we use the sanitize helper ?

 When i tired to use the following code,but it generate a error that
 Undefined class name 'sanitize'

 App::import('Sanitize');
 class MyClass extends App Controller
 {

   function  myfunction()
 {
   *$company_name =  Sanitize::addslashes($this-data['Company']
 ['name']);

 }

 }

 can any one please tell me how can we validate such malicious
 inputs ?

 Thanks in advance
--~--~-~--~~~---~--~~
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: For anyone interested in dynamic sitemaps

2008-07-25 Thread Rich

Thanks Eddie! I'll be bookmarking this one.

On Jul 25, 2:02 pm, Smelly_Eddie [EMAIL PROTECTED] wrote:
 Sitemaps are a pretty standard way to let users and engines understand
 your sites content. Managing one field with hundreds or thousands of
 urls quickly becomes unmanageable.

 I wrote a pretty straightforward tutorial to leverage the webservice
 abilities to feed formatted xml sitemaps to all search engines that
 use the standard (Google, Yahoo, and others)

 http://edwardawebb.com/programming/php-programming/cakephp/generating...

 Theres a comment about performance as well. As long as you minimize
 the queries, its not an issue. I successfully had google pickup a site
 map for 1638 articles.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Boston cake?

2008-07-25 Thread Rich

Anyone in the area know of a local support group for cake developers?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



bakery comment system broken

2008-07-25 Thread jan.ptacek

Hi,
hopefully it will reach its adresee:

The bakery comment system will not accept any Comment/Question
The validation complaint on empty title even when the title is
actually filled in.

best regards
Jan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---