The way I've done this is define the ACOs to be roles and check the user's
access to the required role with Acl->check. That way you can have multiple
roles in a tree-structure and the access checks are super simple. There are
drawbacks though: which role is required for each action is hardcoded
Hi,
I think that you didn't understand the complex ACL logik. But it is
really complex.
The "actions" update, delete, save, add are the actions for the ACO.
So the first question is: what is an ACO? It is an Access Control
Object. Read here more about the logic:
http://book.cakephp.org/view/465/U
Hi all,
Heres the scenario :
I went through the database searching for an email and found it but now i
need to assign that emails user_id from the users table to the new posts
user_id in the posts table - foreign key. How would i do that heres the code
i have so far it works but adds 0 as the use
Aha, a simple solution to every problem :-) That does the trick.
Thanks!
Ella
On Jan 11, 8:39 pm, cricket wrote:
> On Tue, Jan 11, 2011 at 1:25 PM, zzella wrote:
> > Hi,
>
> > I have a model where a field is required on the Add (create) page but
> > can be empty on the Modify (update) page.
>
Hi to all,
I activated the Memcached default support with this config
Cache::config('default', array(
'engine' => 'Memcache',
'duration'=> 9577829600,
'servers' => array(
'127.0.0.1:11211'
),
Hi There
I think you are attempting this wrong.
If you set up your CakePHP Model Associations properly (User->Post->Liking)
then you don't need to find the various ID's to create your relationship.
Instead if your form includes things such as "User.somefield",
"Post.anotherfield", "Liking.anothe
I just noticed this thread. You might want to look at a video someone
uploaded to http://tv.cakephp.org recently showing how to use transactions
with CakePHP
http://tv.cakephp.org/video/guille1983/2011/01/10/database_transactions
--
Larry E. Masters
On Tue, Jan 11, 2011 at 11:44 PM, huoxito w
Thanks stephen, the models are all configured corectly the reason i did it
this way is because im adding all the info for diff models using one
controller action
On Wed, Jan 12, 2011 at 12:29 PM, Stephen wrote:
> Hi There
>
> I think you are attempting this wrong.
>
> If you set up your CakePHP M
Thank you for the update PhpNut :)
On Jan 12, 6:58 pm, "Larry E. Masters" wrote:
> I just noticed this thread. You might want to look at a video someone
> uploaded tohttp://tv.cakephp.orgrecently showing how to use transactions
> with CakePHP
>
> http://tv.cakephp.org/video/guille1983/2011/01/10/
Hi Spha ps,
The controller can add all the info for diff models automatically from
$this->User->save($this->data) if your form has the other models included.
You don't need to do the hard work like in your example.
On 12 January 2011 11:00, Spha ps wrote:
> Thanks stephen, the models are all co
ok i will do that now
On Wed, Jan 12, 2011 at 1:32 PM, Stephen wrote:
> Hi Spha ps,
>
> The controller can add all the info for diff models automatically from
> $this->User->save($this->data) if your form has the other models included.
> You don't need to do the hard work like in your example.
>
Hello, everyone, my question is not strictly CakePHP related but
rather more general PHP question.
Although, since I'm developing with CakePHP maybe there are
conventions how to solve the problem...
I want to have an option to dynamically include "plugins" or CakePHP
elements after a "token" has be
Should I just through it away and continue?
On Jan 11, 9:46 pm, cricket wrote:
> On Tue, Jan 11, 2011 at 4:09 AM, osamo101 wrote:
> > Hi Amit,
>
> > This is very strange, the __l() is repeated in the code over 8000
> > times with strings i.e. __l('Delete'), do you have any idea about how
> > thi
my controller:
---
set('estados',$this->Estado->find('all'));
if($this->data)
{
#tenho que setar os dados para o modelo validar
$this->Usuario->set($this->data['Usuario']
update:
Opera and Firefox can't open my PDF while IE8 does it flawlessly (lol)
i bet this is a header/render issue
On 11 Gen, 12:03, Ernesto wrote:
> Hi all
>
> i just upgraded to 2.0-dev
> the only big problem i'm encountering are on-the-fly generated PDFs
> i'll use one of my views as example
Hello there.
I have create a subdomain on my godaddy hosting. my previeous site was
made by CakePHP now i want to make a subdomain. but getting error :
500 Internal Server Error.
Have you any solution. guys.
thanks.
Masud
Check out the new CakePHP Questions site http://cakeqs.org and help others
Shall we use model without association...instead of association shall
we use direct query in model
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"
Thank you all for answering. I really appreciate it.
My main business is hosting but I also do PHP coding but never did
anything with cake.
As I saw the error, as Ryan stated, it's obvious that there's
something wrong with that sql query. The weird thing is that the site
worked well on other box
Hello to all, I have been trying to write a dynamic district and city
select in cakephp 1.2 using Ajax Helper.
These are the code I wrote, but it isn't work.
I have two db tables, cities and districts in which I have insert all
the Italian district and cities.
Then I have a controller, course_con
I have been cracking at this for about 4 hours, and unable to resolve.
Everything is working as expected except I cannot find an option to
open my link in a new window.
Here is my current view code:
echo $ajax->link(
'Benefits Schedule', array( 'controller' => 'plan_details',
'action' => '
I use OSX for my CakePHP sandbox. save yourself the trouble and use
MAMP. The pseudo LAMP setup in OSX just doesn't work well out of box
for a real developer's sandbox. You might want to give MAMP Pro a
try. Its free for 30 days. The damn thing makes managing PHP+MySQL
+host files (etc/hosts)+Apac
I found a solution that works using Modalbox like:
echo $html->link('Benefit Schedule',array('controller' =>
'plan_details', 'action' => 'view', $plan['PlanDetail']['id'] ),
array('title' => 'Benefit Schedule', 'onclick' =>
"Modalbox.show(this.href, {title: this.title, width: 850}); return
false;"
I personally would just write the links yourself, instead of having to
go through Cake. Manual links + event binds = better.
On Jan 12, 11:56 am, OldWest wrote:
> I found a solution that works using Modalbox like:
>
> echo $html->link('Benefit Schedule',array('controller' =>
> 'plan_details', 'ac
Hi All
I'm having a little difficulty conceptualizing the relationships when
setting up a database/models, for a app I'm starting to develop. If
I'm creating a basic inventory management application I have the
following:
Table Name | Columns
users | id, user_name, email, etc...
items | id, name,
Hello Amit,
Thank you for your reply.
I will try to explain it
First I am editing a record in the edit view. When I save the record
it redirects me to the index view and give a message "Job has been
updated".
Second step is I go to the detail view and check the details after
that I go back to the
Hello,
I have a table that has 5 fields of data.
In many cases, not all of the fields have data in them.
Each time the View action of the Controller is requested, I would like
to only display the fields that have content in them AND the tabular
structure of the data will change based on the cont
Hi all,
does anyone else find it strange, that there is a mixture of
Underscore and Camelcase in the conventions? I mean, I have a table
called "workshop_description" (underscore), the filename is
"workshop_description.php" (underscore), but the model name is
"WorkshopDescription" (Camelcase) and s
Fields don't have casing conventions that I am aware, the only caveat
is that IDs/foreign keys must be underscore: user_id instead of
userId.
Agreed that underscore file names and tables are weird, I would much
rather have them camel case. Especially seeing as how its a great
standard to have file
You see page cached by browser when hit "previous" button there.
Disable cache at all by $this->disableCache() in controller, or do not
use "previous" button.
On 13 янв, 02:14, lvdb wrote:
> Hello Amit,
>
> Thank you for your reply.
> I will try to explain it
>
> First I am editing a record in th
What is the correct CHMOD permission settings for tmp/cache directory.
Unless I set it at 777 I get is not writable [CORE/cake/libs/cache/file.php,
line 267]
Im working on a new server and before I had it set to 755 but now unless its
set to 777 I get the error.
Thanks,
Dave
Check out the new
I am setting up a site with this folder structure:
-var
-- libs
---cake
1.2
1.3
-www
--site
---app
But now im getting Fatal error: Call to a member function html() on a
non-object in /var/www/site/app/views/layouts/default.ctp on line 2
Which is an html() view helper func
Hi,
Most of the time, this error is due to HTTP server mis-configuration and you
need to look at the access and error logs. Most probably this error occurred
for you due to use of .htaccess in CakePHP. Have you allowed configuration
management using .htaccess for your sub-domain (please check for
Hi,
Sure, you can do that by using $this->query() in the model.
Amit Badkas
PHP Applications for E-Biz: http://www.sanisoft.com
On Wed, Jan 12, 2011 at 6:49 PM, Gopinath T.M wrote:
> Shall we use model without association...instead of association shall
> we use direct query in model
>
> Che
Hi,
Have you tested in Firefox with Firebug if the AJAX request goes or not?
Also try to access the AJAX page (something like
http://your-domain/your-directory/cities/getcities) directly in the browser
to check if it outputs what you need.
Hope this helps.
Amit Badkas
PHP Applications for E-Biz
Hi,
If you need this for only a single page then it would be fine to write the
'if' conditions to that action otherwise you can use beforeRender() callback
to change view file's name to render.
Hope this helps.
Amit Badkas
PHP Applications for E-Biz: http://www.sanisoft.com
On Thu, Jan 13, 2
looks similar to my set up. Go to your index.php inside your webroot
and echo some of the defines there. that should give you a hint. or
go to http://cake.pastebin.com/ and past your whole index.php file
there for us to see.
On Jan 12, 10:30 pm, "Dave Maharaj" wrote:
> I am setting up a site with
in whole project i am doing the same methos like "$this->query()"...whether
this will make any problem by performance or achitecture
On Thu, Jan 13, 2011 at 10:11 AM, Amit Badkas wrote:
> Hi,
>
> Sure, you can do that by using $this->query() in the model.
>
> Amit Badkas
>
> PHP Applications for
you have to be mindful of your dir structure. is the subdomain
pointing to a subdir in your original domain? did you move the proper
htaccess files in the process of moving?
On Jan 12, 7:28 am, masud wrote:
> Hello there.
> I have create a subdomain on my godaddy hosting. my previeous site was
>
how to use selected date in
$form->input('dt',array('type'=>'date'));
Miqdad Ali
http://www.miqdadali.co.cc
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You
actually there is a slight performance increase when using $this-
>query($sql). However, its like the size of an Atom's left big toe. if
you are looking for performance increase take a look at
http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/
and also follow semantic
Hi,
The app/tmp directory should be recursively writable by the web server if
PHP is installed as a module (for example, with Apache) otherwise (for
example, with IIS) should be recursively writable by the user which runs
PHP.
Hope this helps.
Amit Badkas
PHP Applications for E-Biz: http://www.
Hi,
The error is 'Fatal error: Call to a member function html() on a non-object
in /var/www/site/app/views/layouts/default.ctp on line 2', so I want to see
what have you written on 2nd line of default.ctp layout because I don't
think there is any helper method like html().
Amit Badkas
PHP Applic
But some time in my project i use to write like this type of code in
controller..
$this->ModelName->query();
Whether this is good habit or i have to avoid this.
if i am using this type of code in my most of the controller...is it any
problem on achitecture and coding standards
On Thu, J
http://www.devcurry.com/2009/07/hide-table-column-with-single-line-of.html
On Wed, Jan 12, 2011 at 11:17 PM, OldWest wrote:
> Hello,
>
> I have a table that has 5 fields of data.
>
> In many cases, not all of the fields have data in them.
>
> Each time the View action of the Controller is reques
Thanks for your info. I figured it out. The helper by the way was for a
facebook helper file. Bet neverthe less it was a simple oversight.checked
error logs and found what was missing.
Thanks for your time all the same.
Dave
From: Amit Badkas [mailto:amit.sanis...@gmail.com]
Sent: Thur
It all depends!
What is the requirement for owning items?
Can a user own more than one of the same item?
What is the requirement for wanting items?
Can a user want more than one of the same item?
Can a want record expire - ie. the user wants the item, but only if
the user can get it within X days/
If you go with the status columns you need two boolean columns one for own
and one for want, its a possible solution.
If you want to use two table you can create users_want and users_own.
The relation for each table should looks like it would be for items_users.
The reason to prefer one implementat
Hi all,
I svn my code to a repo on svn but now the css is not bieng read the
000-default file is set to allow all,i have the .htaccess file and dont know
why this is hapening.
All my other cake application on my local machine work fine except the svn
app
Can anyone please help me with this ?
Chec
user "lorenzo" resolved my problem
http://ask.cakephp.org/questions/view/pdf_output_issue_after_upgrading_to_2_0-dev
i used
$this->response->type("pdf")
instead of
header("Content-type: application/pdf")
On 12 Gen, 16:41, Ernesto wrote:
> update:
>
> Opera and Firefox can't open my PDF while
49 matches
Mail list logo