Re: Component or Behavior?

2011-01-10 Thread Zaky Katalan-Ezra
Consider database triggers.
I recommend using database trigger for REALLY simple situations that involve
no more then 3 line of code.

In you example pseudo code should looks something like this.
After update trigger on competitions .
#If NEW.complete == yes
#Select awardpoints into new_points from competitions
#Update users set points = new_points where id = user_id;

Its better to call stored procedures from within the trigger to do the job.

For more complicated situations create a stored procedure in the database
and call this procedure from your model aftersave();

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Croogo - search form in new theme fail

2011-01-10 Thread Daniel
Hello

I'm creating a new template for Croog. When I realized that the search
form does not work. The code is:
form action=javascript: document.location.href=''+Croogo.basePath
+'search/q:'+encodeURI($('#searchform #q').val()); method=post
id=searchform
   div class=input text
   input type=text id=q value=ad name=q
   /div
   div class=submit
   input type=submit value=Search
   /div
/form

I think the problem is because they do not know to run the javascript:
javascript: document.location.href=''+Croogo.basePath+'search/
q:'+encodeURI($('#searchform #q').val());

Forgive my bad English (Google Translate,;)),

A greeting and thanks in advance,
Daniel

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


I am getting an error like this after i submit an action.

2011-01-10 Thread Deepak
Warning (2): Cannot modify header information - headers already sent
by (output started at C:\xampp\htdocs\todo\app\models\post.php:9) [CORE
\cake\libs\controller\controller.php, line 742]
Code | Context

$status =   Location: http://localhost/todo/posts;

header - [internal], line ??
Controller::header() - CORE\cake\libs\controller\controller.php, line
742
Controller::redirect() - CORE\cake\libs\controller\controller.php,
line 721
PostsController::delete() - APP\controllers\posts_controller.php, line
64
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 85



please help me as i want to finish it of as early as possible.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


how to use multiquery in cakephp

2011-01-10 Thread rez...@gmail.com
H
how to use multiquery in cakephp

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: php echo alternative/shorthand

2011-01-10 Thread euromark
you should read:
http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use

On 10 Jan., 05:55, cricket zijn.digi...@gmail.com wrote:
 On Sun, Jan 9, 2011 at 9:56 PM, zer0_gravity zr...@hotmail.com wrote:
  Question I have noticed that the following statement works
  interchangeable. Is the equal sign '=' that shorthand version to using
  the echo function?

  ?=$variableName['value1'] ;?

  or

  ? echo $variable['value1']; ?

 Yes, although the semi-colon should not be used in the first example.
 Also, both of those are actullay using the shorthand. All of these are
 equivalent:

 ?php echo $foo; ?
 ? echo $foo; ?
 ?= $foo ?

 Also (and this is really important), the short_open_tag directive must
 be enabled in php.ini to use the shorthand. You should never use the
 shorthand if the code may be run on a server that you do not control.
 And, even if it will be, you need to consider that short_open_tag may
 be disabled sometime in the future. Personally, I much prefer to use
 the shortcut than echo. But ONLY with stuff running on servers I
 control, and which I'm not particularly concerned about having to move
 elsewhere.

 http://php.net/manual/en/ini.core.php#ini.short-open-tag
 Google php short_open_tag if you're in the mood for religious wars.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: I am getting an error like this after i submit an action.

2011-01-10 Thread Amit Badkas
Hi,

The error message itself has information for file and line number
('C:\xampp\htdocs\todo\app\models\post.php:9')
you need to look at.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Mon, Jan 10, 2011 at 5:09 PM, Deepak test05041...@gmail.com wrote:

 Warning (2): Cannot modify header information - headers already sent
 by (output started at C:\xampp\htdocs\todo\app\models\post.php:9) [CORE
 \cake\libs\controller\controller.php, line 742]
 Code | Context

 $status =   Location: http://localhost/todo/posts;

 header - [internal], line ??
 Controller::header() - CORE\cake\libs\controller\controller.php, line
 742
 Controller::redirect() - CORE\cake\libs\controller\controller.php,
 line 721
 PostsController::delete() - APP\controllers\posts_controller.php, line
 64
 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
 [main] - APP\webroot\index.php, line 85



 please help me as i want to finish it of as early as possible.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: I am getting an error like this after i submit an action.

2011-01-10 Thread Jeremy Burns | Class Outfit
More specifically, you are probably trying to echo something screen, which is 
causing this error.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Jan 2011, at 11:53, Amit Badkas wrote:

 Hi,
 
 The error message itself has information for file and line number 
 ('C:\xampp\htdocs\todo\app\models\post.php:9') you need to look at.
 
 Amit Badkas
 
 PHP Applications for E-Biz: http://www.sanisoft.com
 
 
 
 On Mon, Jan 10, 2011 at 5:09 PM, Deepak test05041...@gmail.com wrote:
 Warning (2): Cannot modify header information - headers already sent
 by (output started at C:\xampp\htdocs\todo\app\models\post.php:9) [CORE
 \cake\libs\controller\controller.php, line 742]
 Code | Context
 
 $status =   Location: http://localhost/todo/posts;
 
 header - [internal], line ??
 Controller::header() - CORE\cake\libs\controller\controller.php, line
 742
 Controller::redirect() - CORE\cake\libs\controller\controller.php,
 line 721
 PostsController::delete() - APP\controllers\posts_controller.php, line
 64
 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
 [main] - APP\webroot\index.php, line 85
 
 
 
 please help me as i want to finish it of as early as possible.
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
  
 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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 multiquery in cakephp

2011-01-10 Thread Vivi Vivi
We need to use mysqli for this

and I made this method in app_model.php:

/**
 *  Multi Queries
 *
 **/
public function multi_query($query){
$db = ConnectionManager::getDataSource($this-useDbConfig);
$return = mysqli_multi_query($db-connection, $query);
do {
if ($result = $db-connection-store_result()) {
$result-free();
}
} while ($db-connection-next_result());
return $return;
}

On Mon, Jan 10, 2011 at 1:44 PM, rez...@gmail.com rez...@gmail.com wrote:

 H
 how to use multiquery in cakephp

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Vivi
http://photos.vr-3d.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: I am getting an error like this after i submit an action.

2011-01-10 Thread Martin Duris
Hello,

you are put something on output - write something on document (maybe
something in controller ..) and than you are trying to redirect - this cause
error, becose you can redirect after you put something on document

as i see, you have problem in model file ... sometimes hapens to me too (and
this err makes me crazy grr) ... often is made, when you made some blank
space in model file (post.php), you can try to create new model file (don`t
copy, write new...) and check you controller, if you don`t write something

2011/1/10 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com

 More specifically, you are probably trying to echo something screen, which
 is causing this error.

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 10 Jan 2011, at 11:53, Amit Badkas wrote:

 Hi,

 The error message itself has information for file and line number 
 ('C:\xampp\htdocs\todo\app\models\post.php:9')
 you need to look at.

 Amit Badkas

 PHP Applications for E-Biz: http://www.sanisoft.com



 On Mon, Jan 10, 2011 at 5:09 PM, Deepak test05041...@gmail.com wrote:

 Warning (2): Cannot modify header information - headers already sent
 by (output started at C:\xampp\htdocs\todo\app\models\post.php:9) [CORE
 \cake\libs\controller\controller.php, line 742]
 Code | Context

 $status =   Location: http://localhost/todo/posts;

 header - [internal], line ??
 Controller::header() - CORE\cake\libs\controller\controller.php, line
 742
 Controller::redirect() - CORE\cake\libs\controller\controller.php,
 line 721
 PostsController::delete() - APP\controllers\posts_controller.php, line
 64
 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
 [main] - APP\webroot\index.php, line 85



 please help me as i want to finish it of as early as possible.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en



 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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


  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Cake source code optimization

2011-01-10 Thread Adrian Arnautu
Hi to all,

I've been developing a Cake App for the past months and now I'm at the point
when some code optimization is required.
Did any of you made some Cake core lib optimization?
If so, could you share some tips and point me where to look.

Of course, the bottlenecks could be in my database or even in my code, but
I'd like to take into account the possibility that there might be some slow
code in the Cake itself.

Thanks,
Adrian

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Cake source code optimization

2011-01-10 Thread euromark
i would have liked that cake offered some kind of packed core (like CI
- code igniter - does)

all relevant core files that are required on every single request
(30-40?) combined and minified
directly included by the dispatcher or whatever
although opcode cache should already minimize the include process
delay



On 10 Jan., 16:19, Adrian Arnautu arnautu.adr...@gmail.com wrote:
 Hi to all,

 I've been developing a Cake App for the past months and now I'm at the point
 when some code optimization is required.
 Did any of you made some Cake core lib optimization?
 If so, could you share some tips and point me where to look.

 Of course, the bottlenecks could be in my database or even in my code, but
 I'd like to take into account the possibility that there might be some slow
 code in the Cake itself.

 Thanks,
 Adrian

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Cake source code optimization

2011-01-10 Thread Jon Bennett
 i would have liked that cake offered some kind of packed core (like CI
 - code igniter - does)

 all relevant core files that are required on every single request
 (30-40?) combined and minified
 directly included by the dispatcher or whatever
 although opcode cache should already minimize the include process
 delay

doesn't using an opcode cache like APC makes minifying php source
completely pointless?

j

-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: php echo alternative/shorthand

2011-01-10 Thread Miles J
Dont use:

?

Only use:

?php

However, shorthand only works if its enabled in your ini settings and
should rarely be used (templates are an exception):

?=

On Jan 10, 3:45 am, euromark dereurom...@googlemail.com wrote:
 you should 
 read:http://stackoverflow.com/questions/200640/are-php-short-tags-acceptab...

 On 10 Jan., 05:55, cricket zijn.digi...@gmail.com wrote:

  On Sun, Jan 9, 2011 at 9:56 PM, zer0_gravity zr...@hotmail.com wrote:
   Question I have noticed that the following statement works
   interchangeable. Is the equal sign '=' that shorthand version to using
   the echo function?

   ?=$variableName['value1'] ;?

   or

   ? echo $variable['value1']; ?

  Yes, although the semi-colon should not be used in the first example.
  Also, both of those are actullay using the shorthand. All of these are
  equivalent:

  ?php echo $foo; ?
  ? echo $foo; ?
  ?= $foo ?

  Also (and this is really important), the short_open_tag directive must
  be enabled in php.ini to use the shorthand. You should never use the
  shorthand if the code may be run on a server that you do not control.
  And, even if it will be, you need to consider that short_open_tag may
  be disabled sometime in the future. Personally, I much prefer to use
  the shortcut than echo. But ONLY with stuff running on servers I
  control, and which I'm not particularly concerned about having to move
  elsewhere.

 http://php.net/manual/en/ini.core.php#ini.short-open-tag
  Google php short_open_tag if you're in the mood for religious wars.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: a problem regarding id field in url

2011-01-10 Thread gremlin
The edit form should include either a hidden field for id, or pass the
current id in the url via the action param.

On Jan 9, 12:06 pm, manas gajare manas.prince...@gmail.com wrote:
 I am facing an issue about 'id' field in the regular *
 localhost/project/comments/edit/5* structure.

 Let's say I have 5 fields for comment, all are validated as 'non empty'
 through model.
 While editing one comment I put one field blank.
 On submitting the form, naturally it gives me error (coming from model)
 saying 'nonempty'.
 Without entering anything in that field, I hit submit again, now I face the
 issue. What happens this time is that 'id' field from the url is now gone, (
 *localhost/project/comments/edit/*) and there is a new entry in database.
 (ideally it should update though).

 What might be the error?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Cake source code optimization

2011-01-10 Thread euromark
thats what i remarked at the end :)
i suppose it does

as for the other bottlenecks we will have to wait for 2.0 (and lazy
loading for all kinds of stuff)



On 10 Jan., 17:05, Jon Bennett jmbenn...@gmail.com wrote:
  i would have liked that cake offered some kind of packed core (like CI
  - code igniter - does)

  all relevant core files that are required on every single request
  (30-40?) combined and minified
  directly included by the dispatcher or whatever
  although opcode cache should already minimize the include process
  delay

 doesn't using an opcode cache like APC makes minifying php source
 completely pointless?

 j

 --
 jon bennett -www.jben.net- blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Plugin tutorial in the book

2011-01-10 Thread Parris
Hi All,
I was wondering why the plugin tutorial names models like:
PizzaOrderModel. I understand Pizza is the name of the plugin, and
am fine with that, but the word model throws off the convention. Plus
it breaks a few other things like validation. It also forces you to
use: var $uses in your controllers. When I take the word model out of
the name everything works as expected and should.

Thanks,
Parris

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Form Validation does not work on Cake 1.3.6

2011-01-10 Thread Kh3ops
Hi,

I installed cake 1.3.6 on PHP 5.3.3.

I've just run through the blog tutorial and everything's working
fine except form validation.
For an unknown reason, validating an empty form works and databases is
filled with empty records.

Here is what I used in my model code :

 var $validate = array(
'title' = 'notEmpty'
);

Any idea?

Compared to the tutorial, I also had to use $form() instead of $this-
Form() functions in templates files. Do you know why?

Thanks for your help,

Gaëtan

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: During edit -- if validation fails, user is returned add form

2011-01-10 Thread manasmanas

Hey I'm facing the same issue. 
How did you resolve it?

Manas
http://dexterltd.com
-- 
View this message in context: 
http://cakephp.1045679.n5.nabble.com/During-edit-if-validation-fails-user-is-returned-add-form-tp1279924p3334519.html
Sent from the CakePHP mailing list archive at Nabble.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Clueless...Help please

2011-01-10 Thread javier0051
Hi

I am a completely newbie to cake php. A new customer has a site
developed with cake php and we recently moved the site to one of our
boxes but we haven't been able to show all the page's content. No
errors, the news  articles and other stuff are actually in the
database BUT no contents are displayed. (site's main page: www.acepweb.org.ar
Undisplayed contents example url (http://www.acepweb.org.ar/c/noticias/
ultimas-noticias)

The problem comes when trying to access one of the interior sections.
The contents are in the database, the routing.php file has this line
(Router::connect('/c/:categoria/:subcategoria', array('controller' =
'categories', 'action' = 'view', 'categoria' = null, 'subcategoria'
= null));) directing to some /c/ folder or whatever it is but it is
not physically present.

The connection to the db is established propperly but at this point I
am totally clueless on how to get that example page to display the
contents it used to display when hosted on the other box, with same
cPanel, same linux operating system.

Thank you .Help will be totally appreciated

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to paginate HABTM relations

2011-01-10 Thread Synue Cunioci
Hi everybody!

Here is the thing: I have a table called tags and other six
tables(informatives, courses, activities, events, documents and
clippinngs) that has a a HABTM relation with the table tags.

I have something that I call supertags. It´s a list of the 8 most
tagged tag. This list contains a link to a method that receives the id
of the tag and should return another list (an paginated one) with the
entries of the other tables (informatives, courses, activities,
events, documents and clippinngs) that have the relation with the tag.

What I did at first was $this-Tag-find('first', array('conditions'
= array('Tag.id' = '$id')), with recursive=1 and then manipulate the
array.

But then I discovered that the paginate() method needs the first
params to be a model, and not an array.

So I read a lot of posts about paginate and HABTM relations but since,
I'm new at cake, I couldn't understand a bit. I think that the answer
lies on something about afterFind and bind.

So, can someone with a lot of patience explain to me how to join the
tables and fetch the result paginated??

Thanks in Advance!!


PS: Cricket, if you see the post can you reply to me? You are the only
one that replied my posts

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Clueless...Help please

2011-01-10 Thread Dr. Tarique Sani
Can't seem to reach the URL you have mentioned but have you tried
setting the Debug on?

Probably you are not seeing any errors because Debug is set to 0

HTH
Tarique


On Mon, Jan 10, 2011 at 7:43 PM, javier0051 javier.ange...@gmail.com wrote:
 Hi

 I am a completely newbie to cake php. A new customer has a site
 developed with cake php and we recently moved the site to one of our
 boxes but we haven't been able to show all the page's content. No
 errors, the news  articles and other stuff are actually in the
 database BUT no contents are displayed. (site's main page: www.acepweb.org.ar
 Undisplayed contents example url (http://www.acepweb.org.ar/c/noticias/
 ultimas-noticias)

 The problem comes when trying to access one of the interior sections.
 The contents are in the database, the routing.php file has this line
 (Router::connect('/c/:categoria/:subcategoria', array('controller' =
 'categories', 'action' = 'view', 'categoria' = null, 'subcategoria'
 = null));) directing to some /c/ folder or whatever it is but it is
 not physically present.

 The connection to the db is established propperly but at this point I
 am totally clueless on how to get that example page to display the
 contents it used to display when hosted on the other box, with same
 cPanel, same linux operating system.

 Thank you .Help will be totally appreciated

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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




-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Plugin tutorial in the book

2011-01-10 Thread Amit Badkas
Hi,

http://book.cakephp.org/view/1114/Plugin-Models doesn't have what you
mentioned. It uses model name as 'PizzaOrder' and not 'PizzaOrderModel'.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 5:42 AM, Parris presid...@parrisstudios.com wrote:

 Hi All,
 I was wondering why the plugin tutorial names models like:
 PizzaOrderModel. I understand Pizza is the name of the plugin, and
 am fine with that, but the word model throws off the convention. Plus
 it breaks a few other things like validation. It also forces you to
 use: var $uses in your controllers. When I take the word model out of
 the name everything works as expected and should.

 Thanks,
 Parris

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Form Validation does not work on Cake 1.3.6

2011-01-10 Thread Amit Badkas
Hi,

Your description of the validation problem is too less to give any
suggestion. Also about the usage of $form instead of $this-Form, you can
use $form in CakePHP-1.3.x but it will be removed in future versions and
that's why you have to use $this-Form.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Mon, Jan 10, 2011 at 6:38 AM, Kh3ops gaetan.all...@gmail.com wrote:

 Hi,

 I installed cake 1.3.6 on PHP 5.3.3.

 I've just run through the blog tutorial and everything's working
 fine except form validation.
 For an unknown reason, validating an empty form works and databases is
 filled with empty records.

 Here is what I used in my model code :

  var $validate = array(
'title' = 'notEmpty'
);

 Any idea?

 Compared to the tutorial, I also had to use $form() instead of $this-
 Form() functions in templates files. Do you know why?

 Thanks for your help,

 Gaëtan

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Fatal error: Call to undefined function __l()

2011-01-10 Thread osamo101
Hello,

I have a website written in CakePHP 1.2 and I am upgrading it to 1.3,
when I try to run it, it displays the error Fatal error: Call to
undefined function __l() , could you please tell me what is that
function? and what function should I use instead of it if it is
deprecated.

thanks in advance.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Clueless...Help please

2011-01-10 Thread Dr. Loboto
Check error logs. And/or turn debug on and go to page to see actual
errors.

On Jan 10, 8:13 pm, javier0051 javier.ange...@gmail.com wrote:
 Hi

 I am a completely newbie to cake php. A new customer has a site
 developed with cake php and we recently moved the site to one of our
 boxes but we haven't been able to show all the page's content. No
 errors, the news  articles and other stuff are actually in the
 database BUT no contents are displayed. (site's main page:www.acepweb.org.ar
 Undisplayed contents example url (http://www.acepweb.org.ar/c/noticias/
 ultimas-noticias)

 The problem comes when trying to access one of the interior sections.
 The contents are in the database, the routing.php file has this line
 (Router::connect('/c/:categoria/:subcategoria', array('controller' =
 'categories', 'action' = 'view', 'categoria' = null, 'subcategoria'
 = null));) directing to some /c/ folder or whatever it is but it is
 not physically present.

 The connection to the db is established propperly but at this point I
 am totally clueless on how to get that example page to display the
 contents it used to display when hosted on the other box, with same
 cPanel, same linux operating system.

 Thank you .Help will be totally appreciated

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Fatal error: Call to undefined function __l()

2011-01-10 Thread Amit Badkas
Hi,

I don't think there is/was any __l() function in CakePHP-1.2.x, it may be
written in any file which got overwritten.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 12:09 PM, osamo101 osamo...@gmail.com wrote:

 Hello,

 I have a website written in CakePHP 1.2 and I am upgrading it to 1.3,
 when I try to run it, it displays the error Fatal error: Call to
 undefined function __l() , could you please tell me what is that
 function? and what function should I use instead of it if it is
 deprecated.

 thanks in advance.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Clueless...Help please

2011-01-10 Thread Ryan Schmidt
On Jan 10, 2011, at 08:13, javier0051 wrote:

 No errors, the news  articles and other stuff are actually in the
 database BUT no contents are displayed. (site's main page: www.acepweb.org.ar
 Undisplayed contents example url (http://www.acepweb.org.ar/c/noticias/
 ultimas-noticias)
 
 The problem comes when trying to access one of the interior sections.
 The contents are in the database, the routing.php file has this line
 (Router::connect('/c/:categoria/:subcategoria', array('controller' =
 'categories', 'action' = 'view', 'categoria' = null, 'subcategoria'
 = null));) directing to some /c/ folder or whatever it is but it is
 not physically present.

Router::connect() is not directing to some /c/ folder or whatever; 
Router::connect() informs CakePHP that when a visitor accesses a URL of the 
form /c/:categoria/:subcategoria (where :categoria and :subcategoria are 
placeholders which stand for any value), CakePHP will invoke the view method 
of the categories controller. You may want to spend some more time reading 
the CakePHP documentation to better understand this and other basics of CakePHP 
applications.

http://book.cakephp.org/view/875/x1-3-Collection





Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: a problem regarding id field in url

2011-01-10 Thread manas gajare
Thanks buddy!
Resolved the issue!!

On Tue, Jan 11, 2011 at 1:53 AM, gremlin abba.bry...@gmail.com wrote:

 The edit form should include either a hidden field for id, or pass the
 current id in the url via the action param.

 On Jan 9, 12:06 pm, manas gajare manas.prince...@gmail.com wrote:
  I am facing an issue about 'id' field in the regular *
  localhost/project/comments/edit/5* structure.
 
  Let's say I have 5 fields for comment, all are validated as 'non empty'
  through model.
  While editing one comment I put one field blank.
  On submitting the form, naturally it gives me error (coming from model)
  saying 'nonempty'.
  Without entering anything in that field, I hit submit again, now I face
 the
  issue. What happens this time is that 'id' field from the url is now
 gone, (
  *localhost/project/comments/edit/*) and there is a new entry in database.
  (ideally it should update though).
 
  What might be the error?

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Best way to achieve my ACL goal?

2011-01-10 Thread Pehmolelu
Any advice is appreciated

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Component or Behavior?

2011-01-10 Thread Jeremy Burns | Class Outfit
I'd do it from within the main model, assuming that all of the models are 
related.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Jan 2011, at 07:01, Eric Anderson wrote:

 Hi everyone,
 
 I'm creating an app and have a situation where after an event occurs,
 I need to save data in many different models. Essentially, when a
 competition ends, I need to save the winner, award points to everyone
 who entered the competition and as well as award credits.
 Essentially, I end up editing 4 (or more) different models when a
 competition ends and needs to be evaluated.
 
 What's the best way to handle things like this, where an event occurs
 but the consequences affect many models?
 
 Thanks!
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: post form data from URL

2011-01-10 Thread Ryan Schmidt
On Jan 2, 2011, at 11:29, Steve Mallett wrote:

 http://localhost/links/add?foo=http://asdfasdf/adsfe/asdf  variations
 thereof work great using
 $foo = $this-params['url']['foo'];
 echo $this-Form-input('Link.url', array('value'=$foo, 'type' = 'text'));
 
 However, when hitting http://localhost/links/add the error: Notice
 (8): Undefined index: foo [APP/views/links/add.ctp, line 12]  Should I
 be setting $foo to null somehow?

Certainly, if $this-params['url'] does not contain an element 'foo' you should 
not be attempting to access element 'foo'. This is basic PHP array usage.

if (isset($this-params['url']['foo'])) {
// do something with $this-params['url']['foo']
} else {
// do something that does not try to use $this-params['url']['foo']
}


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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