I suggest you turn on debug and add some debug statements in between
your code, so you can see what the content of each variable is at
specific places. Debug is turned on in your core.php file in the
config directory.
Use debug statements:
debug($basename);
debug($file_extension);
and maybe some m
No, not that way, you have to use your existing code and use an inner
loop, example:
[code]
<- your outer loop! Good!
...
...
<- the inner loop!
...
[/code]
The outer loop gives you an array containing the 'staff' and the
'room' arrays.
The inner loop takes the room array
beforeFilter() isn't a constructor. Its just a normal method, which is
used as a callback.
You should never overwrite the constructor as it has important code.
That's what the callbacks are for, to define custom code to not
conflict.
Also, this has nothing really to do with PHP 4 or 5, its a
arch
If I understand you correctly Dave, then you have a page A on which is
a newsletter signup form. When the user submits an e-mail address, you
want to present the user to page B if the e-mail address is valid. If
the e-mail address is not valid, stay on page A. Correct?
Assuming I am correct :) ...
Can I refere to a complete documentation how can I work with strict
PHP5 on CakePHP?
For example : Can I remove beforeFilter() and use __construct() instead ?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this messa
thank you very much.
On 3 fév, 23:41, Jeff Deroshia wrote:
> You can't rewrite in userDir directories, since they are already
> rewritten:http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
>
> On Wed, Feb 3, 2010 at 9:20 AM, cherif_Gsoul wrote:
>
> > hi, i need help for installing cakephp i
thank you i apperciate your help.
On 3 fév, 18:58, "Daniel S. Reichenbach"
wrote:
> Hi,
>
> > hi, i need help for installing cakephp in a linux's public_html
> > directory exactly fedora 12, i put cakephp in that directory but it
> > seems that the mod_rewrite doesnt work and i dont know how to e
I tried using App Import model set up but got the same error message. Is
that what you mean?
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Miles J
Sent: February-04-10 3:39 AM
To: CakePHP
Subject: Re: app function
You must have the mod
John
Hello,
i tryed:
[code]
,
[/code]
But with that code i get the following error-message: "Warning (2):
Illegal offset type [APP\views\staffs\index.ctp, line 40]".
Where is my fault?
Thanks very much!
Check out the new CakePHP Questions site http://cakeqs.org and hel
You must have the model Link defined and loaded before you run your
navigation method.
On Feb 3, 9:38 pm, "Dave" wrote:
> How do i run a function from app controller?
>
> in app_controller i have in beforeFilter {
> $this->buildNavigations();
>
> }
>
> function buildNavigations()
> {
>
> $l
John
Hello,
thanks for your answer! :)
I've added your code.
Well, I found out, that my old code (same result with your code) also
works, but only with 3 of my 4 test-data-rows.
It works for '13.pdf', '288.pdf' and '3.pdf'. It fails for
'19.pdf' (result on click = 19.pdf.pdf) and i absolutely dont
John
Hello,
thanks for your answer! :)
I've added your code.
Well, I found out, that my old code (same result with your code) also
works, but only with 3 of my 4 test-data-rows.
It works for '13.pdf', '288.pdf' and '3.pdf'. It fails for
'19.pdf' (result on click = 19.pdf.pdf) and i absolutely dont
John
Hello,
thanks for your answer! :)
I've added your code.
Well, I found out, that my old code (same result with your code) also
works, but only with 3 of my 4 test-data-rows.
It works for '13.pdf', '288.pdf' and '3.pdf'. It fails for
'19.pdf' (result on click = 19.pdf.pdf) and i absolutely dont
I did debug the data; it was fine. My usual first strategy also :-)
The answer was 'on' => 'create', not 'add'.
On Feb 4, 12:32 am, Jeremy Burns wrote:
> This might not be the answer you are looking for, but when I have had similar
> issues before I have always debugged $this->data at various p
How do i run a function from app controller?
in app_controller i have in beforeFilter {
$this->buildNavigations();
}
function buildNavigations()
{
$links = $this->Link->find('list');
//$links = $this->find('list');
}
Resilts in:
Undefined property: PagesController::$Link
I s
http://dev.mysql.com/doc/refman/5.0/en/federated-use.html
On Wed, Feb 3, 2010 at 11:08 PM, Bryan De Asis wrote:
> Sorry Zaky can you elaborate it more... what do you mean by create a view
> in the database that select from the other database?
>
> Thanks
>
>
> On Wed, Feb 3, 2010 at 3:45 PM, Zaky
This might not be the answer you are looking for, but when I have had similar
issues before I have always debugged $this->data at various points to see what
is actually being validated and saved. Then I double check the shape of the
data against the save (and if necessary, saveAll) functions in
Thanks a lot!
[Resolved] :D :D
On Feb 3, 4:56 am, John Andersen wrote:
> You probably need to add this to your view, so that any parameters in
> the URL is passed on to the paginator in the view.
>
> [code]
> $paginator->options(array('url' => $this->passedArgs));
> [/code]
>
> Seehttp://book.
Oops. I messed up the call to validate(). But, when I do ...
if ($this->User->create($this->data) && $this->User->validates())
{
if ($this->User->save($this->data, true))
{
... validation passes! It should fail. WTF?
Check out the new CakePHP Questions site http://cakeqs.org and
cake_1.2.6
I'm thoroughly confused by what's happening (or not happening) with my
validation. For one thing, save() does not appear to be calling
validate(). Even when I pass true as the 2nd param, validation does
not occur.
Secondly, the validation, when called explicitly, seems to be wrong.
Us
Ok, so I want to pass an image from my custom file browser to
CKEditor. Here, the code I'm using to draw the image in the file
browser :
image('pool/' . $image, array('width' => 155,
'onclick' => 'window.opener.CKEDITOR.tools.callFunction(' .
$func_num . ', \'/mysite/img/pool/' . $image . '\')'));
Hi Pau,
Are you using 1.2? If so, $this->renderElement is deprecated and you
should use $this->element instead. You can read up on elements at
http://book.cakephp.org/view/97/Elements.
But this specific situation sounds like a perfect task for a helper.
Helpers (see http://book.cakephp.org/view/10
everything is encrypted...
On Wed, Feb 3, 2010 at 4:45 PM, Miles J wrote:
> From an architecture standpoint, storing credentials in a database is
> a pretty bad idea.
>
> On Feb 3, 1:08 pm, Bryan De Asis wrote:
> > Sorry Zaky can you elaborate it more... what do you mean by create a view
> in
I have a form in an element and wondering how to return back to the page it
was sent from if its successful or if there are errors display the errors on
the same page.
Basically its a side menu and at the bottom a mini form to signup for
newsletter which is on every page. So if the user adds thei
You don't need to use mod_rewrite to share one cake core with multiple apps.
Instead, in app/webroot/index.php change the following:
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
To
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', D
I did something similar using the relations of the main model in this
instance. In this case the model 'Message' could be associated with
different things, 'Product', 'Invoice', etc. There were only a few, so I
made a separate relation for each using the 'conditions' parameter to filter
by relate
Use the bundled php bin from MAMP in your call to bake i.e. /
Applications/MAMP/bin/php/php5/bin/php
cheers.
On Feb 3, 6:20 pm, B_Fraser wrote:
> I've spent a few hours on this so far and haven't had any luck. I've
> read all the previous posts but still no joy.
>
> When I attempt to bake I get
You can't rewrite in userDir directories, since they are already rewritten:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
On Wed, Feb 3, 2010 at 9:20 AM, cherif_Gsoul wrote:
> hi, i need help for installing cakephp in a linux's public_html
> directory exactly fedora 12, i put cakephp in
I think I found an article that fixed this issue.
It can be found here:
http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find
I had read it before when searching... but didn't realize that it was
what I had been looking for all along.
Sorry for the misspelled "querys"
I've spent a few hours on this so far and haven't had any luck. I've
read all the previous posts but still no joy.
When I attempt to bake I get:
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (2) in /Applications/MAMP/htdocs/cake/
acl_tutorial
Hello,
Sorry for the strangely-worded question title. I've been searching
around for a few days here on the CakePHP doc book, CakePHP group, and
around the Internet but I haven't been able to find a tip on how to do
this.
I have a MySQL database with these tables (names are simplified):
+ schoo
hi,
I have scenario , where i want to save a meeting, and meeting has
relation with topic habtm,
Tables: Meeting, Topic, MeetingsTopics
Meeting HABTM with Topic
this sample data is working fine,
[Meeting] => Array
(
[date] => 2010-02-10
[Priority] => 1
)
Hi there everyone. Newbie CakePHP individual here. This framework has
really taught me the concepts of MVC, moreso than Drupal ever did,
anyway.
I have a question regarding the ACL component: I understand that the
component restricts access of a requester object to a control object
based on contro
Hi Guys
I am working on a project with distributed database (5000 users per
each).
Can Cakephp support such system?
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 th
>From an architecture standpoint, storing credentials in a database is
a pretty bad idea.
On Feb 3, 1:08 pm, Bryan De Asis wrote:
> Sorry Zaky can you elaborate it more... what do you mean by create a view in
> the database that select from the other database?
>
> Thanks
>
> On Wed, Feb 3, 2010 a
Sorry Zaky can you elaborate it more... what do you mean by create a view in
the database that select from the other database?
Thanks
On Wed, Feb 3, 2010 at 3:45 PM, Zaky Katalan-Ezra wrote:
> Create a view in the database that select from the other database.
> This way you need only one connect
The basename function returns the filename with the suffix! Try to
change your code to:
[code]
$basename = basename($file);
$file_extension = substr(strrchr($basename,"."),1);
$basename = basename($file, '.'.$file_extension);
...
$this->set('extension', strtolower($file_extension));
[/
Create a view in the database that select from the other database.
This way you need only one connection.
On Tue, Feb 2, 2010 at 7:58 PM, Bryan De Asis wrote:
> Co'z I'm creating a database table which contains the database connection
> credentials so i can have thousands hundreds of config... s
Hi,
hi, i need help for installing cakephp in a linux's public_html
directory exactly fedora 12, i put cakephp in that directory but it
seems that the mod_rewrite doesnt work and i dont know how to enable
it for public_html but it works very well in /var/www/html and i
configured the console too
Hi,
When using cake console, 'cake schema run create DbAcl' throws the
default cake schema help but if i use 'cake schema create DbAcl' i was
prompted to create acos, aros and aros_acos tables.
is this the expected behavior?
as stated in the Migration guide[1] this is indeed intended behavior
Yes straight SQL, as schema files are only really usable in the
shell.
On Feb 3, 2:06 am, Lorenzo Bettini wrote:
> Yes, I finally did that, and switch to the UpdatesController when the
> tables are in place.
>
> I noted that you use sql directly, and not schema files generated by
> cake console,
hi ShereWeb,
> I am somewhet a newbie to CakePHP. I am trying to migrate my website
> from own framework to CakePHP. Everything is wonderful until i got to
> tree behavior issue for categories. I will explain a little bit what i
> am trying to achieve:
>
> I have many categories that can have mult
Hello,
I am somewhet a newbie to CakePHP. I am trying to migrate my website
from own framework to CakePHP. Everything is wonderful until i got to
tree behavior issue for categories. I will explain a little bit what i
am trying to achieve:
I have many categories that can have multiple parent categ
Do a foreach loop on the $staff['Room'] array in the table cell!
Enjoy,
John
On Feb 3, 9:24 am, sebb86 wrote:
> Hello,
> in my database, there is a HABTM association between model "rooms" and
> "staffs".
> In my index-view of "staffs", when i retrieve the data, i'd like to
> have an extra colu
I'm not sure I understand the problem directly, so I'll just try to
give an example of how you can use the model class' custom validation
methods to handle a validation of two fields at the same time.
>From the book, check out how to manage custom validations (http://
book.cakephp.org/view/152/Add
It's actually a php function: http://php.net/manual/en/function.compact.php
Jeremy Burns
jeremybu...@me.com
On 3 Feb 2010, at 16:16, McScreech wrote:
> Hello,
>
> Where do I find the definition or explanation of '$this->set(compact
> ())' in the Cookbook or API?
>
> Thanx, DaveT.
>
> Check ou
Hello,
Where do I find the definition or explanation of '$this->set(compact
())' in the Cookbook or API?
Thanx, DaveT.
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 Go
Hopefully a slightly better method... I've created a custom AppModel
that ensures that every field listed in the 'fieldList' during save
(whitelist) has all of its rules set to 'required'... and it will also
complain if the 'fieldList' isn't provided to the save() method.
whitelist as $cField) {
take a look at:
http://www.mail-archive.com/cake-php@googlegroups.com/msg33243.html
they discussed the Problem an found a nice solution!
On 3 Feb., 08:47, sebb86 wrote:
> Hello,
> my table **rooms** contains three fields: //id//, //building_id//
> and //room//.
>
> //Building_id// and //room// h
Hi! If there any manual or article on how use CakeShema? I'm
interested in using models & using bare sql in before() and after()
methods.
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 sub
I don't have time at the moment to look through all of that (though I
do appreciate your thoroughness). The first thing I would recommend
is try disabling all of your redirects from your related (user?)
controller's methods. By doing so, you should once again be able to
see the SQL debug output w
That would only solve his testing methods here. If his host supports
IPv6, it's still possible for him to get those values under his
production site from visitors. It's best to account for both.
On Feb 2, 11:24 am, Andras Kende wrote:
> Tomas,
>
> You could try disable IPV6:
>
> System prefer
If you want to validate the data input from that form, you'd still
need to create a model class (and schema variable). You won't have to
create a database table, but it might still be helpful to you to
create the model class itself.
On Jan 31, 5:33 am, Jules wrote:
> Bingo! It's a beautiful thin
You probably could have found that particular error out had you
checked the Apache error logs. I would suggest checking both
CakePHP's error logs (app/tmp/logs/error.log), as well as your
server's error logs to determine what could be the cause.
If there are no errors on your Linux server, verify
Hi,
i am using cake 1.3.0-beta from git (git clone
git://github.com/cakephp/cakephp1x.git
and git checkout 1.3.0-beta).
When using cake console, 'cake schema run create DbAcl' throws the
default cake schema help but if i use 'cake schema create DbAcl' i was
prompted to create acos, aros and aros
I think the best solution is to have app1 app2 and so on in the root
(same level of cake...) instead.
Max-B
Il giorno mar, 02/02/2010 alle 18.37 -0330, Dave ha scritto:
> I am trying to set up multiple apps using 1 cake so i have currently:
> public_html/
> dev/
>
This should be:
define('CAKE_CORE_INCLUDE_PATH',DS.'dev'.DS.'lib');
On Feb 3, 6:07 am, "Dave" wrote:
> I am trying to set up multiple apps using 1 cake so i have currently:
> public_html/
> dev/
> libs/
> cake1.2.6/
>
Hello,
I'd like to show the following things in my view (respectively in the
field uplink_id in the view): attribute "uplink_id" from table "ports"
with attribute "schenker_number" from table "hardware_units".
My problem are the associations, respectively i don't know the source
code to retrieve th
Hello,
my table **rooms** contains three fields: //id//, //building_id//
and //room//.
//Building_id// and //room// have to be UNIQUE together, because room
9 is in building 1 only one time but room 9 can also conained in
building 2.
The //building_id// in the view is realized as a drop-down field
Hello,
i almost solved my problem, but there is still a little fault. In one
of my views i readout a database cell, with a text inside, e.g. 13.pdf
(13.pdf = document_name).
The little fault is, when i click on the text in the column (e.g.
13.pdf) a download-windows opens and the file i download i
Hello,
in my database, there is a HABTM association between model "rooms" and
"staffs".
In my index-view of "staffs", when i retrieve the data, i'd like to
have an extra column for each datarow with all rooms, which belongs to
the current staff(id).
The join table contains "room_id" and "staff_id"
Hi,
I am trying to use Searchable Behaviour hosted here:
http://code.google.com/p/searchable-behaviour-for-cakephp/
To initialize the search_index table with existing data, I have used this:
http://code.google.com/p/searchable-behaviour-for-cakephp/issues/detail?id=1&q=controllerReply
No. 2 which c
I think that the use of 'with' and 'joinTable' attributes is excatly
for tha case where models tables don't respect the cake convention
otherwise these attributes aren't useful
On 3 Feb, 15:23, Lorenzo Bettini wrote:
> I'm not sure, but it looks like the problem is due to the table name
> which i
I'm not sure, but it looks like the problem is due to the table name
which is in Italian, thus, it does not respect the conventions of
cakephp; have you got a model for GroupsUser as well? I mean a real
class for that model? In that case, you need to make sure that that
class has the right na
hi, i need help for installing cakephp in a linux's public_html
directory exactly fedora 12, i put cakephp in that directory but it
seems that the mod_rewrite doesnt work and i dont know how to enable
it for public_html but it works very well in /var/www/html and i
configured the console too .
Tkx
On Feb 2, 11:07 pm, "Dave" wrote:
> I am trying to set up multiple apps using 1 cake so i have currently:
> public_html/
> dev/
> libs/
> cake1.2.6/
> site1/
> /app
>
Do you have a cake directory under cake1.2.6?
If not, then rename the cake1.2.6 directory to cake and use:
define('CAKE_CORE_INCLUDE_PATH',DS.'dev'.DS.'lib');
I have this directory setup:
/cake
/app1
/app2
/app3
and I use the following in the /appx/webroot/index.php to define the
constants:
...
As far as I can understand from your tables, and your own statement:
> Tuotteet hasOne Tekstit which hasMany Kaannokset.
then the following associations should be defined:
1) Tuotteet hasOne Tekstit
This means that Tekstit has a field named tuotteet_id if you follow
the CakePHP conventions.
But l
Is there someone that can help me about this?
On 2 Feb, 19:02, "marco.rizze...@gmail.com"
wrote:
> Hi
> I'm working on a legacy system , i must to defina an HABTM relation
> between User and Group. In User model I have this:
>
> var $hasAndBelongsToMany=array(
> 'Group' =>
You probably need to add this to your view, so that any parameters in
the URL is passed on to the paginator in the view.
[code]
$paginator->options(array('url' => $this->passedArgs));
[/code]
See http://book.cakephp.org/view/166/Pagination-in-Views for the
pagination setup in the view.
Enjoy,
Hi AD,
>> I think what I want is a habtm that can connect to multiple models
>> with some additional fields in the join table, but I'm not sure that's
>> feasible, but hope it is.
>
> a join table with more than 2 fields is a model, and a model that can
> link to anything is (as you know) polymorp
Thanks Jeremy,
the best way to solve a problem is to explain to an other person :)
2 min after i wrote it I found following solution:
foreach($this->data['mode'] as $v=> $val){
if(empty($val)) unset($this->data['model'][$v]);
}
Then cake or better say MySql takes the default value
Thanks
You could either add a hidden text field to the form or set
$this->data['model']['field'] to the value in the controller before you do a
save.
Jeremy Burns
jeremybu...@me.com
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573
On 3 Feb 2010, at 10:16, matzeh...@goog
Hi,
what would you do if you want to save a default value and don´t want
to predefine a input field?
I tried with a custom validation rule but the return of it is true/
false not the corrected value.
Is the best way to do this in an function in the controller?
Greetings
Check out the new CakePHP
Yes, I finally did that, and switch to the UpdatesController when the
tables are in place.
I noted that you use sql directly, and not schema files generated by
cake console, don't you?
cheers
Lorenzo
Miles J wrote:
I had to do the same thing for my plugin. Simply dont use Models.
h
Hi.
I'm traying to display in a view a string asociated to a field value.
.. echo $varp ..
endforeach;
?>
I need to reuse this switch statement in other views. I create an
element with this code and store this file in the views/elements
folder.
renderElement('mycode');
.
.. e
On Feb 3, 2:46 am, Jon Bennett wrote:
> Hi bakers,
>
> Been mulling this over and haven't hit on the ideal solution yet, so
> thought I'd try and put it down to get some outside ideas.
>
> I'm trying to find a flexible way to associate a record in one table
> with many other records from other t
77 matches
Mail list logo