You have to change the condition so that the check for NULL is done on
the foreign key, not on the Policy table, so the condition becomes:
WHERE `Notification`.`user_id` = 'adffd636' AND ((`Policy`.`status` =
0) OR
(`Notification`.`policy_id` IS NULL)) LIMIT 15
Enjoy,
John
--
Our newest site
With Policy hasMany Notification, using the find() on Policy creates a
LEFT JOIN with Notification. Since you want all notifications (with
user_id = $me) whether or not there is a Policy, the join should
either be Notification LEFT JOIN Policy or Policy RIGHT JOIN
Notification. (For more explanat
Just off the top of my head, for freelance work:
Western countries - $50 - $125/hr.
India/Russia/Africa - $8 - $25/hr.
Where you fit in that range is determined by a host of issues which
you need to objectively decide for yourself.
--
Our newest site for the community: CakePHP Video Tutorials
This still feels very wrong. I think you need to simplify.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 17 Feb 2011, at 06:01, damia...@gmail.com wrote:
> It work. I check directly url to function and returned data. I want
> display resault by helper
>
>
Yes, you can do a find in models that are linked by association. So your
example $this->Model1->Model2->Model3->find() is valid.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 17 Feb 2011, at 06:01, damia...@gmail.com wrote:
> It work. I check directly url
It work. I check directly url to function and returned data. I want
display resault by helper
function getGroupsList(){
App::import('Controller', 'groups');
$group = new GroupsController();
return $group->groupList();
}
In view:
getUsersList();?>
I think that is pr
That is really complicated and probably unnecessary code. You shouldn't be
importing models into a view - a view is just there to render the output of a
controller function. Why can't you gather this data in your controller and just
pass it as a variable?
Where is your getGroupsList function?
It work. I check directly url to function and returned data. I want
display resault by helper
function getGroupsList(){
App::import('Controller', 'groups');
$group = new GroupsController();
return $group->groupList();
}
In view:
getUsersList();?>
App::import('Model
Paginating the Policy with contains since the Policy is related to many
models where the Notification is only related to Notification
SQL spits:
...monster contain JOINS cut from code.
WHERE `Notification`.`user_id` = 'adffd636' AND ((`Policy`.`status` = 0) OR
(`Policy`.`status` IS NULL)) LIM
Is your find/paginate being executed on the Notification model or the
Policy model? The conditions I provided should be executed on the
Notification model. Basically, the SQL you want should be something
like:
SELECT
FROM `notifications` AS `Notification`
LEFT JOIN `policies` AS `Policy` ON (`
Sorry, I forgot to include the Notification.user_id => $me:
'conditions' => array(
'Notification.user_id' => $me,
'OR' => array(
'Policy.status' => 1,
'Policy.status IS NULL'
)
)
or for MySQL:
'conditions' => array(
'Notification.user_id' => $me,
'IFNULL(Policy.status, 1)' => 1
Thanks for that , but as it got me closer to the Policy data it now does not
pull any Notifications that are external. Still just associated matching
records.
Never All Notifications that have a Policy.id based on Policy.status along
with all Notifications with no Policy.
Using:
'conditions'
Try:
'conditions' => array(
'OR' => array(
'Policy.status' => 1,
'Policy.status IS NULL'
)
)
or for MySQL:
'conditions' => array(
'IFNULL(Policy.status, 1)' => 1
)
On Feb 16, 10:54 am, "Krissy Masters"
wrote:
> Sorry I did not explain the Notifications better.
> If a Notificatio
Hello,
Now i am trying like this.
http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
but still validation from model class it not working. Please please suggest.
My Model:
array(
'required' => true,
'allowEmpty' => false,
'rule'
42
Answer to all such questions and life is 42 ;-)
Cheers
Tarique
On Thu, Feb 17, 2011 at 4:22 AM, Jeremy Burns | Class Outfit
wrote:
> £36.
>
--
=
PHP for E-Biz: http://sanisoft.com
==
Just for day names and format you need helpers/behavior and components?
Pray why?
How you display a date is purely a View problem, rest of your code
(controllers and models) should have to just deal with date values
which are recognized by PHP and your database.
Cheers
Tarique
On Wed, Feb 16,
Did you change the names respectively in the controller functions?
class GroupsController extends AppController {
var $name = 'Groups';
var $uses = array('Group');//not needed
var $components = array('Session', 'Auth');//place in app_controller
}
class Group extends AppModel {
do you try with define('FULL_BASE_URL','http://' .
$_SERVER['SERVER_NAME']); ?
or a condition
if ( $_SERVER['SERVER_NAME'] == 'bla' ) {
define('FULL_BASE_URL','http://www.myexternaldomain.com');
} elseif ( $_SERVER['SERVER_NAME'] == 'blalocal' ) {
define('FULL_BASE_URL','http://localhos
You don't need a lot of the code you have written as Cake does it for you,
assuming you write it correctly.
If you have a table 'groups' this is all you need:
/app/controllers/groups_controller.php
class GroupsController extends AppController {
var $name = "Groups";
var $compone
file names ?
On 17 feb, 00:42, "damia...@gmail.com" wrote:
> I change names but my problem don't solved.
>
> Undefined property: GroupsController::$Group [APP/controllers/
> groups_controller.php, line 30]
>
> On 17 Lut, 03:51, "Krissy Masters" wrote:
>
>
>
>
>
>
>
> > Names are backwards.
>
> >
I change names but my problem don't solved.
Undefined property: GroupsController::$Group [APP/controllers/
groups_controller.php, line 30]
On 17 Lut, 03:51, "Krissy Masters" wrote:
> Names are backwards.
>
> Controllers are plural
> class GroupsController extends AppController {
>
> Models are
Well, it's not the ideal solution but I can get the links to work through
the proxy server by adding this line to paths.php:
define('FULL_BASE_URL','http://www.myexternaldomain.com');
and then I also had to set the security level to low in core.php.
But then this means that went I access the c
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Milos,
i'm developing with php 5.3.1 in my development server and it's ok.
Maybe i have very few data records, but i'm working with this server
since january 5 and i have no problem. My mysql is 5.1.41 and my apache
version is 2.2.14
I hope this in
I don't mind using URL like this but are you sure that validation will work
like this?
Regards
Tapan Thapa
Sent from my iPhone
On Feb 16, 2011, at 11:36 PM, euromark wrote:
> you are mixing cake pretty urls and plain url style
>
> why not going with
> /.../x:1/y:2/z:3
> and using
> $this->p
Hi!
If I call another model then jpgraph gives error image can not be
displayed.Even if I create model for that controller,it also gives error.How
to add another model data in jpgraph?
Code in controller:
layout='';
$this->loadModel('Production');
$prd=$this->Production->find('all');
}
function i
Names are backwards.
Controllers are plural
class GroupsController extends AppController {
Models are singular
class Group extends AppModel {
K
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of damia...@gmail.com
Sent: Wednesday, Februar
Hi everyone.
I have a big problem. I create model and controller:
class GroupController extends AppController {
var $name = 'Group';
var $uses = array('Groups');
var $components = array('Session', 'Auth');
class Groups extends AppModel {
var $name = 'Groups';
var $useTable = '
On Wed, Feb 16, 2011 at 7:46 PM, barricades wrote:
> Thanks for the reply. I'm learning :)
OK, here's another tip: you don't need to save the email to the
session. Auth already does that for you. :-)
When a user logs in, every column in the users table is stored in the
session. There two ways to
I still have'n created a web interace to control permissioins with aros and
acos but i guess the Acl component would deal with most of the stuff.
Are you using the Acl behavior on your user model? I don't think that user
should be repeated on the aros table ...
--
Our newest site for the comm
... sharing how ended up the git hook post-receive script:
cd ~/myapp/public_html
env -i git reset --hard
env -i git pull origin master
cake migration all
cake deploy cache
I used both plugins said above, and it's been working great so far.
Now I'm able to update my app with only one push comman
As much as you can and they are willing to pay and not a penny more :)
How much are you worth?
Years experience?
Quality of end result?
Speed?
Reputation?
Clientele?
You develop for Monica's Neighborhood Flowershop vs Fortune 500?
These are questions only you can answer. Everyone is differen
Thanks for the reply. I'm learning :)
On Feb 17, 12:24 am, Miles J wrote:
> Its because you are redirecting before setting the data.
>
> Try this, assuming you are using the Auth component.
>
> function login() {
> $this->set('error', false);
>
> if ($this->Auth->user()) {
>
Its because you are redirecting before setting the data.
Try this, assuming you are using the Auth component.
function login() {
$this->set('error', false);
if ($this->Auth->user()) {
$this->Session->setFlash('You are logged in!');
$this->Session->
Hey there, I have a login function in which I had added some code to
write a users email to the session.
For some reason when I used this code:
function login() {
$this->set('error', false);
//see if the user is already logged in
/*if ($this-
Just incase anyone else has the same problem it was because I needed
to add $this->Auth->autoRedirect = false; in the app controller to
stop the login action automatically redirecting me before my custom
code was executed.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.c
Hi Ryan,
Thanks for the help.
No the Euro character was not the problem.
The problem was some spam checking that was going on in the
application (implemented prior to me acquiring the project) which
worked for English language but not for German. The answers were being
saved to the database whic
The only way to price something is to:
- get the proper requirements
- make sure they are what the customer wants
- write them up and get the client to sign it off
- work out how long it will take you to do it
- double it (because you always underestimate)
- make sure the customer agrees that the t
£36.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 16 Feb 2011, at 22:47, euromark wrote:
> its a suggestive question like "what car should i bye"
> plus its not even remotely cake related
>
> so nobody in this group will probably be able to help you with
its a suggestive question like "what car should i bye"
plus its not even remotely cake related
so nobody in this group will probably be able to help you with this...
On 16 Feb., 23:17, hydra12 wrote:
> I've been offered a one-time job to develop a database driven form for
> someone's website.
I've been offered a one-time job to develop a database driven form for
someone's website. I don't have any idea what to charge. I've done
some of this before, but always when I was on salary. Anybody want to
give me some advice?
Thanks in advance!
hydra12
--
Our newest site for the community
I do the very same thing with a contacts hasMany addresses and a
contacts hasMany phones type relations
The form uses some simple scriptaculous/prototype javascript. To
duplicate and insert an html template set to display=none. It changes
the display and updates the field id's each time the "add" b
On Wed, Feb 16, 2011 at 2:05 PM, glk wrote:
> Hello, I'm finally trying to use jQuery, and everything is working ok,
> but none of the themes seem to work "nicely" with the default
> cake.generic.css.
You don't have to use Cake's stylesheet. That's just there so that
certain things look more or l
I think that if you don't have a model called "line" then I would create one
called "LineType" or "Linetype". I might even go so far as to say "Line" and
not type?
On 16 February 2011 18:54, paul_rogers6 wrote:
> Hi Stephen
>
> Many thanks for the reply. As you say the name doesn't make much
>
On Wed, Feb 16, 2011 at 12:33 AM, divisionbyzero
wrote:
> Hello,
>
> i'm very new to CakePHP. In my app, i can load cake.icon.png and
> cake.power.gif in webroot/img dir. But i cannot load any other images.
Can you show an example of an image that isn't displaying? I mean, the
code you're using.
I don't use it but I do believe it is called themeroller which is an online
tool on the jquery ui site to skin the css.
Border, background, fonts, colours and it will return you a fully formatted
css for the ui.
Also make your own css or edit the cake.generic.css file.
I highly doubt you're going
I'm serving up my cakephp app through a proxy server and the problem I'm
having is that the login redirect is using an absolute url instead of a
relative one.
I traced the issue down to the url() function in the Router class. The url()
function is responsible for constructing the url.
>Fro
Hello, I'm finally trying to use jQuery, and everything is working ok,
but none of the themes seem to work "nicely" with the default
cake.generic.css.
They want to change everything! I'm really just trying to use the
jquery.ui.tabs right now, but by the time I get the general theme
stuff, and the
It's something to do with the local caching. Use the "clear local
cache" and change pages and it works ... briefly.
On Tue, Feb 15, 2011 at 8:58 PM, Josh Prowse wrote:
> I'm not really sure if this is the place for this, but the CakePHP
> site doesn't make how to contact the web master obvious, s
Not sure how your relationships work .. but could that uncommented
relationship perhaps create an infinite loop?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakeP
Sorry I did not explain the Notifications better.
If a Notification is made thru the form (external notification, not related
to a Policy on the site) then it has no policy_id Simply a record in the
table with
id so when the JOINS with POLICY happens all the external are automatically
forgot abou
Hi Stephen
Many thanks for the reply. As you say the name doesn't make much
sense without the Address in it especially as there are other
"LineTypes" etc in the system. If as you suggest I use
AddressLineType am I right in thinking the table name is
address_line_types and cake'd have a problem w
Dwayne, thanks for the detailed reply :)
I'll try it later today when I have time and update here.
Thank u guys!
On Feb 15, 9:36 pm, Dwayne Hanekamp wrote:
> Hello Yaron,
>
> For this u need to use the jquery plugin for dynamic forms
> (http://www.quackfuzed.com/demos/jQuery/dynamicField/).
> T
> Just create a static class, include it, and use it statically anywhere
> in your application.
Or that, right. Going back to my cave.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help ot
Why don't you just place the specialMethod() code into initialize()?
Since thats basically what you are trying to achieve.
On Feb 16, 2:51 am, Pixelastic wrote:
> Hello,
>
> I'm writing a MainComponent that will need a SecondaryComponent in
> order to correctly work.
> I want to call some of Seco
Or not use a helper, controller or behavior. Just because you are
using Cake doesnt mean you have to ditch PHP conventions all together.
Just create a static class, include it, and use it statically anywhere
in your application.
DateFormat::convert();
On Feb 16, 10:01 am, 100rk wrote:
> And ano
On 16 February 2011 18:09, Ryan Schmidt wrote:
> > Also is there a way to upgrade
> > your cms form 1.2 to 1.3 and what would be the steps ?
>
> I would say of course there is always a way. But what is this "cms form"?
>
Is there a way to upgrade CakePHP from 1.2 to 1.3
Please see attached lin
Hi Paul
On 16 February 2011 14:51, paul_rogers6 wrote:
> Secondly, if I have a table called address_types and a table called
> address_line_types is my join table have the name
> address_line_types_address_types? It seems a bit long winded!! Is it
> acceptable to call my class for the line typ
On Feb 16, 2011, at 12:03, Miloš Vučinić wrote:
> I am a little bit desperate. My hositng house moved to php 5.3 but my
> web site is on cake php 1.2 made for earlier php versions.
>
> My bad luck is that at the very same moment we added shopping cart to
> the web site when the hosting house cha
I'm getting a exhausted memory fatal error when accessing a
controller, no matter how many memory is set in php.ini (well, just
set it to 500+ MB and get also exhausted, but I think it will consume
all the memory in the universe).
Following what AD7six said in
http://groups.google.com/group/cake-
you are mixing cake pretty urls and plain url style
why not going with
/.../x:1/y:2/z:3
and using
$this->params[named]
?
if you don't mind my asking
On 16 Feb., 12:49, Tapan Thapa wrote:
> Hello Community,
>
> I want to create a url like this.
>
> http://localhost/cakephp/incomings/request/?ms
It can be hard to detect if a quality exists or not already without some
extra work.
I would try to check against lowercase and uppercase strings (personally I
would use strtolower() and ucwords()) - then you need to check against
things like plural or non-plural etc.
I agree with euromarks sugge
Hi guys,
I am a little bit desperate. My hositng house moved to php 5.3 but my
web site is on cake php 1.2 made for earlier php versions.
My bad luck is that at the very same moment we added shopping cart to
the web site when the hosting house changed to php 5.3 and made some
restrictions about u
And another correction (it was written right here, sorry):
> public function prettyDate($Model, $timestamp) {
> $alias = $this->_getAlias($Model);
> return date($this->settings[$alias], $timestamp);
> }
return date($this->settings[$alias]['format], $timestamp);
--
i can see that you are new to cake :)
a few hints for the beginning
dont use find(all) for those things - find(first) will do the trick if
you look for a (unique) record (by name in this case)
you also start to use $data without initializing it
this can cause warnings
init:
$data = array();
befo
It doesn't make any difference but I always have my last item without a
comma
On 15 February 2011 23:24, euromark wrote:
> i'd say it is totally irrelevant :)
>
> On 15 Feb., 20:08, MissYeh wrote:
> > Whether you leave it or not should not matter. PHP can handle both.
> Whether
> > is a good pr
> //in controller
> public $components = array('DateFormat' => array('format' => 'r'));
> public $helpers = array('DateFormat' => array('format' => 'r'));
>
> $this->prettyDate(null, time());
Correction (for controller and view):
$this->DateFormat->prettyDate(null, time());
--
Our newest site f
this is one downside of the current "helper" style for dates etc
the time helper needs to be manually included in the controller etc
(with dependencies inside the helper causing trouble sometimes)
so i agree with you that the situation is not perfect right now
i would like the following DRY approa
Take it just as an example:
class DateFormatBehavior extends ModelBehavior {
public function setup($Model, $config = array()) {
$defaults = array('format' => 'c');
$alias = $this->_getAlias($Model);
$this->settings[$alias] = array_merge($defaults, $conf
hello all;
I'm setting up an application with complex permissions and I have a
bunch of questions. I'm trying to setup a web interface to let
administrators specify which groups have which permissions. Is that
possible/reasonable? I also want each user to have edit/delete access
to their own stuff
On Feb 15, 2011, at 23:33, divisionbyzero wrote:
> i'm very new to CakePHP. In my app, i can load cake.icon.png and
> cake.power.gif in webroot/img dir. But i cannot load any other images.
Why not -- what happens when you try to access that image's URL in the browser?
Does the web server provid
I built my own helper for converting dates, because I need to deal
with german day names, and now I need the same helper in controllers,
models and views. I like the concept of helpers, components etc, but
how do I organize this "helper" so I don't need to repeat myself by
creating a DateFormatHelp
Code in controller:
layout='';
$this->loadModel('Production');
$prd=$this->Production->find('all');
}
function introGraph(){
}
function showGraph(){
}
}
?>
On Wed, Feb 16, 2011 at 10:14 PM, sanjib dhar wrote:
> Hi!
>
> If I call another model then jpgraph gives error image can not be
> display
Hi!
If I call another model then jpgraph gives error image can not be
displayed.Even if I create model for that controller,it also gives error.How
to add another model data in jpgraph?
On Wed, Feb 16, 2011 at 2:34 PM, sanjib dhar wrote:
>
> controller:
>
> class GraphsController extends AppCont
Hi
I'm just starting out with CakePHP. I'm trying to ensure my tables
meet the naming conventions for Cake. I have a couple of questions I
hope some one might help with.
I understand that when producing lists and possibly slugs(?) etc Cake
can take a default value and use it to display the name
Hello,
i'm very new to CakePHP. In my app, i can load cake.icon.png and
cake.power.gif in webroot/img dir. But i cannot load any other images.
For example, i have a logo.png in webroot/img dir and it cannot be
loaded. I converted it to gif in Photoshop and now it can be loaded :S
i have read an
Hello Community,
I want to create a url like this.
http://localhost/cakephp/incomings/request/?msisdn=919871701375&operator=AIRTEL&circle=DELHI
and i am accepting this request in my controller like below code and
passing it to model for validation but it is not working in case i
left any variabl
Hello Yaron,
For this u need to use the jquery plugin for dynamic forms (http://
www.quackfuzed.com/demos/jQuery/dynamicField/).
The Librarian can click on a button and the new fields will appear.
For each field use a default name with [] at the end (which will make
it stack like a array) example:
Allright, so i'm starting to get around with Cakephp, and i'm
currently working at a schoolproject in which you need to be able to
add qualities to your profile. They need to be able to add lots of
qualities (so Users <> Qualities is a HaBtM relation). The problem i'm
walking allong is that i want
Hello,
I'm writing a MainComponent that will need a SecondaryComponent in
order to correctly work.
I want to call some of SecondaryComponent::specialMethod() in
MainComponent::initialize(), but this method can only correctly work
if SecondaryComponent::initialize() is itself called first.
Diving
Yes, another view because I need a class called PDF as in "class PDF
extends PDF_MySQL_Table" where MySQL_Table is in /app/venders/fpdf.
Tried moving class PDF to pdf.php in /app/venders/fpdf/ but that
generated a 'not found' error. I think the problem starts because I
put class PDF in one of my vi
Do you need to go to another page (by which I presume you mean view)? Could it
not be another controller (or model) function? If so, just pass your data as
variables in the function. You can then redirect to a 'completed' or 'post
action' page afterwards.
Jeremy Burns
Class Outfit
jeremybu...@
Thanks for your suggestion Sanjib. I am looking at it now and I may
end up using it but it would mean rewriting some existing reports and
I would prefer to avoid that.
On Feb 15, 5:05 pm, Antar wrote:
> I am using $this->redirect() which explains why I lose the values. Is there
> an alternative t
I need to go to another page, I think. I use another page to create
the pdf report. The other page contains the Class PDF - should I move
this to its own php file?
Sorry if this is all basic stuff - this is my first cakephp project &
is turning out more "entertaining" than I anticipated.
Thanks
controller:
layout='';
}
}
?>
view:
SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(50,10,10,10);
// Create the bar plots
$b1plot = new BarPlot($data1y);
$b1plot->value->SetFormat('%d');
$b1plot->value->SetAlign('left','center');
$b1plot->value->SetColor('black','darkred');
On Feb 14, 2011, at 08:51, josef corley wrote:
>$new_name
> =substr( str_shuffle(
> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) ,
> 0 , 15 );
You should really investigate using the tempnam() function instead of
reinventing it.
http://php.net/tempnam
--
Well said.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 16 Feb 2011, at 08:42, Dr. Tarique Sani wrote:
> On Wed, Feb 16, 2011 at 2:07 PM, sanjib dhar wrote:
>> solved.
>>
>
> Please,
>
> Even if you have solved it - it would be nice if you post how you
On Wed, Feb 16, 2011 at 2:07 PM, sanjib dhar wrote:
> solved.
>
Please,
Even if you have solved it - it would be nice if you post how you
solved it. It would be help someone in the future.
Don't just take - give back as well.
Cheers
Tarique
--
===
solved.
On Wed, Feb 16, 2011 at 12:00 PM, Ryan Schmidt
wrote:
>
> On Feb 16, 2011, at 00:15, sanjibdhar...@gmail.com wrote:
>
> > By searching I got this link as an example
> >
> http://www.uaemex.mx/uniradio/jpgraph/docs/html/823Addingadropshadowtothebar.html#8_2_3
> >
> >
> > In that link value
88 matches
Mail list logo