Here it is on pastebin as it's fairly awkward to read.
http://pastebin.com/m6e44f0b
--~--~-~--~~~---~--~~
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 u
A section of a site I am building needs a revision system and so
decided to keep it simple, similar to the one on stack overflow.
I quickly created the following which works although looks a little
messy. I know I can use beforeSave and afterSave but I have no idea
how I could implement it.
data
ok sory, ignore me.
$this->Comment->markAs('ham');
it is because of the aksimet behaviour.
On Oct 10, 1:42 pm, "#2Will" wrote:
> ok, the same code works for my approved field. so it is sometihing to
> do with the spam column. i checked it is a tinyint(1).
>
> still stuck though.
>
> On Oct 10,
ok, the same code works for my approved field. so it is sometihing to
do with the spam column. i checked it is a tinyint(1).
still stuck though.
On Oct 10, 1:31 pm, "#2Will" wrote:
> Hi, when i try and save to my tinyint(1) field, i the sql is turning
> the value to Null, seemingly whatever i d
I want to set up my website so I can have urls like:
sample.com/search/
sample.com/search/q:search+terms/
sample.com/search/country:us/region:oh/
..etc..
I also want to be able to do reverse routing w/ my links. I have my
routes.php set up like:
Router::connect('/search/*', array('controller' =
Hi, when i try and save to my tinyint(1) field, i the sql is turning
the value to Null, seemingly whatever i do. What am i doing wrong?
I am doing stuff like this:
$this->Comment->read(null, $key);
$this->Comment->saveField('spam', 1, false);
or
$data = array('Comment'=>array('id'=>$key, 'spam
Normally, with CakePHP, you have a controller for each model. That's
not set in stone, of course, but if you have a CompaniesController, it
should automatically have access to a Company model. Hence, you can
simply do $this->Company->whatever(). Perhaps there's some issue
you've uncovered where us
Sorry, Cake is 1.2.5, server is Apache 2.2 running on windows, and PHP
is 5.2.
Don't know if it's relevant.
On 9 oct, 17:12, Franco Bonazza wrote:
> Hello,
>
> Here's my problem
>
> Something this simple:
>
> // controller
>
> Class ExsController extends AppController{
> public function list(){
A header() only sends a header information to the browser, it does not
stop the following php code from executing. Probably you should use a
die() or exit() after the header!
Enjoy,
John
On Oct 9, 11:44 pm, Dewald Pretorius wrote:
> Given the following scenario:
>
> a) In an app controller me
Please show the code that your find consist of, so that we may make a
better informed guess :)
Enjoy,
John
On Oct 10, 12:23 am, "rrd...@gmail.com" wrote:
> I have a find('count',...) check in my application.
>
> It seems sometimes it returns a boolean false even when there is 1 row
> in the t
Nope still no luck. But with htaccess files thruout the site...which one
should I be editing I guess I should have asked first.
Same message:
Grade C on Compress components with gzip
There are 2 plain text components that should be sent compressed
* css/min/styles_typography_125509.css
I have two tables, both very simple.
Desks:
id, name
Question_Tallies
id, created, desk_id, question_type_id
I'm trying to get the id, and created fields that are associated with
a single desk id. My query code is below:
$this->QuestionTally->contain('Desk.id = '.$desk_id);
$thisWeek = $this-
It's possible I generate actions / view with the names that I want?
For example: when I generate a CRUD system, instead of generating the
action "add" change the name to "adicionar" without touching code?
Sorry for writing, I'm Brazilian.
--~--~-~--~~~---~--~~
You
Given the following scenario:
a) In an app controller method you do a header redirect to an external
site (I did it directly with header() not with $this->redirect).
b) Since there's no view output, no ctp file exists.
c) The controller method is named somemethod(), not __somemethod().
When Co
Hello,
Here's my problem
Something this simple:
// controller
Class ExsController extends AppController{
public function list(){
$this->Session->setFlash('Hello');
$this->redirect('/exs/new',null,true); // or redirect + die()
}
public function new(){}
}
// view layout
flash()
hello,
I have set up a cakephp app which works ok in a subdir main of the
document root
so I have access to the app by http://www.mainsite.com/main/
what I would like is to access everything without the need to mention
main in the url
and I cannot change the document root
neither can I put cak
I have a find('count',...) check in my application.
It seems sometimes it returns a boolean false even when there is 1 row
in the table what meets the conditions. Sometimes happens this and
sometimes it returns 1.
Any ide why? Is there a bug?
--~--~-~--~~~---~--~~
On 9 Ott, 18:35, "Dr. Loboto" wrote:
> Check for correct rules key.
I don't think the problem is with the rules key.
As I wrote in my post if I log $this->validate after setting myrules,
that is:
$this->Mymodel->setValidation('myrules');
$this->log($this->validate);
I find the correct rules in
Thanks.
It turned out the problem was due to the way the browsers handle
HTTP_REFERER. I had to put in a kluge for Webkit browsers that would
use a javascript redirect so that the referers were from the same
domain before the session got created. Icky but functional for now.
On Oct 9, 3:10 pm,
AddOutputFilterByType DEFLATE text/html text/plain text/xml
application/xml application/xhtml+xml application/rss+xml application/
json text/css text/javascript application/javascript application/x-
javascript
On Oct 9, 4:41 pm, "Dave Maharaj :: WidePixels.com"
wrote:
> I have the asset helper
The connection with the DB is supposed to be done by the model, not by
the controller. But it does not matter here.
Using the model or the controller, it does not work as expected.
On 9 out, 17:56, brian wrote:
> Why use ClassRegistry::init() if this code is in your
> CompaniesController? You
I see this
Response Headers
DateFri, 09 Oct 2009 19:26:11 GMT
Server Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2
mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
X-Powered-ByPHP/5.2.9
Cache-Control must-revalidate
Accept-Encoding gzip, deflate
Expires Fri, 09 Oct 2009 19:26:
Try turning checkAgent to true. The session security might be killing
it.
On Oct 9, 11:52 am, osodani wrote:
> Hi,
>
> I've read through a dozen similar threads but I can't get sessions to
> work with WebKit-based browsers. I've tested Safari 4, Chrome, WebKit,
> and even the iPhone Safari. I've
Well look at your request/response headers. Is gzip compression even
working?
On Oct 9, 11:34 am, "Dave Maharaj :: WidePixels.com"
wrote:
> Could you explain "doing it the cake way"?
>
> Cake combines the scripts just fine. but after that?
>
> -Original Message-
> From: robust solution [
On Oct 9, 1:27 pm, Aivaras wrote:
> Hey,
>
> App::import('Controller', 'PostsController');
> $this->Posts = new PostsController();
> $this->Posts->add($this->data);
>
> Cheers,
> Aivaras
I would strongly recommend you re-think how you're going about this.
However, if worst comes to worst and you
On Oct 8, 6:55 am, alberto wrote:
> .
>
> I want to sort by date, the date variable is contained into name_item1
> and name_item4 that are two different names
> so i tried to use this path {n}.{s}.date but doesn't work probably
> becouse there is name_item2 and name_item3 ???
You can also us
Hi,
I've read through a dozen similar threads but I can't get sessions to
work with WebKit-based browsers. I've tested Safari 4, Chrome, WebKit,
and even the iPhone Safari. I've tested on different PCs and Macs.
Firefox and IE work fine. I'm running CakePHP 1.2.5.
Here are the core.php values I'v
Could you explain "doing it the cake way"?
Cake combines the scripts just fine. but after that?
-Original Message-
From: robust solution [mailto:i...@robustsolution.net]
Sent: October-09-09 12:20 PM
To: CakePHP
Subject: Re: JS / CSS Compression
Dear Dave,
What I recommend you is to
Uh you should never do that. Why would you import a controller to do
an add()?
On Oct 9, 10:27 am, Aivaras wrote:
> Hey,
>
> App::import('Controller', 'PostsController');
> $this->Posts = new PostsController();
> $this->Posts->add($this->data);
>
> Cheers,
> Aivaras
>
> On Fri, Oct 9, 2009 at 15
Hello,
Can nobody help me with this problem?
Thanks for your help,
On Oct 8, 9:17 am, san1981 wrote:
> Hello,
>
> I'm a newbee in cakephp and I have a little problem with my
> administration
> access.
>
> I've created a route /admin to have access to all my administration
> pages
> with a logi
Hey Brian,
Thanks for answering.
die($content) returns the message, in pristine condition : )
die($View->layoutPath) returns the correct path, email/text
die($View->renderLayout($content)) oddly returns:
Fatal error: Call to a member function entity() on a non-object in
(...)/cake/libs/view/h
If all you want to do is to prevent a user from deleting something
they are authorized to view, but not delete, then that code is all you
need.
If, however, you want to prevent a savvy user, or a curious user, or a
malicious user, from changing the URL and accessing data they are NOT
authorized t
Hey,
App::import('Controller', 'PostsController');
$this->Posts = new PostsController();
$this->Posts->add($this->data);
Cheers,
Aivaras
On Fri, Oct 9, 2009 at 15:37, toneee wrote:
>
> Hi Guys,
>
> I wonder if anyone can help?
>
> How would I call an add function in one controller in another
Hi Dr. Loboto !
Thank you for responding...
I could have done that...but the foremost problem is that there will
be more than 1 individual users to be added to the table however
in other two tables there will be really very few users (less than
1 even in next 5 years). Secondly, individu
Today I started using this version of the cakephp-filter-component:
http://github.com/josegonzalez/cakephp-filter-component. Had some
trouble...
When posting the filter form nothing happend. After searching in the
code it suddenly hit me: I use the CakePHP Security component and that
does not all
Why use ClassRegistry::init() if this code is in your
CompaniesController? You should be able to just do:
$this->set('companies', $this->Company->getAll());
Come to that, why even have a getAll() method?
$this->set('companies', $this->Company->find('all'));
On Fri, Oct 9, 2009 at 12:52 PM, rlc
Yes, I was referring to the model names.
Right now the code is really simple because I'm trying to figure out
what is the problem.
#app/controllers/companies_controller.php
function admin_search() {
$companies = ClassRegistry::init('Company')->getall();
How are you calling the method in your controller (or model)?
On Fri, Oct 9, 2009 at 10:28 AM, leo wrote:
>
> I'm using tree behaviour and want to remove a node from the tree
> without deleting its children.
>
> I'm having trouble getting this to work. The manual says
> 'removeFromTree()' and li
Check for correct rules key.
On Oct 9, 4:00 pm, emmexx wrote:
> I'm trying tu use Dardo Sordi MultivalidatableBehavior (http://
> bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-
> validation-rulesets-per-model).
>
> I have a form where, depending on the value of a field (a
On Fri, Oct 9, 2009 at 11:08 AM, rlcabral wrote:
>
> Hi,
>
> Something really strange is happening on my app.
>
> I have a function called "search". It is working fine.
>
> However, if I login and use the same search function, I get an
> internal error message.
>
> Now, the most strange thing on
If you can move this code into model it will be better then
requestAction.
On Oct 9, 4:30 pm, armen wrote:
> On Oct 9, 1:20 am, "Dr. Loboto" wrote:> Move
> $this->images values assign in separate method and call it both
> > in getMedia() and getImages(). If I remember right, cake creates new
>
Users and companies have at least 3 common columns - id, login and
password. Keep them in one table and put specific fields in 2 others.
Point Auth to 'united' model. That's all.
On Oct 9, 9:26 pm, braaan wrote:
> Hello,
>
> my currect application has normal User (Employees) and Company models
>
On Fri, Oct 9, 2009 at 1:02 AM, Bruno Bergher wrote:
>
> Hi there,
>
> Summary: when using EmailComponent I bump into a strange problem in
> the View class. Using CakePHP 1.3.0.0.
>
> I'm using EmailComponent in a very standard way. In my controller I
> have:
>
> $this->Email->to = 's...@email.c
Thank you Brian thats what i was looking for
On Oct 9, 9:04 am, brian wrote:
> On Fri, Oct 9, 2009 at 11:19 AM, Simon wrote:
>
> > if that code gose to controller then this should go to view but the
> > other users will see this link
> > link(__('Delete', true), array('action'=>'delete',
> > $
On Fri, Oct 9, 2009 at 11:19 AM, Simon wrote:
>
> if that code gose to controller then this should go to view but the
> other users will see this link
> link(__('Delete', true), array('action'=>'delete',
> $comment['Comment']['id']), null, sprintf(__('Are you sure you want to
> delete # %s?', tr
Hi,
Something really strange is happening on my app.
I have a function called "search". It is working fine.
However, if I login and use the same search function, I get an
internal error message.
Now, the most strange thing on this. If I change the code and instead
of searching on the table "Co
Set debug to 2. When set to 0, Cake displays a 404 message. It's
probable that you have an error somewhere. Perhaps your files are not
in sync. Or, maybe there's a permissions problem. Also, check Cake's
error log.
On Fri, Oct 9, 2009 at 4:59 AM, Michael Gaiser wrote:
> I have been making a site
I have a test case, example:
class ArticlesControllerTest extends CakeTestCase {
function testAdd() {
$data = array('Article' => array('user_id' => 1, 'published'
=> 1, 'slug'=>'new-article', 'title' => 'New Article',
'body' => 'New Body'));
$result = $this->testAction('/a
if that code gose to controller then this should go to view but the
other users will see this link
link(__('Delete', true), array('action'=>'delete',
$comment['Comment']['id']), null, sprintf(__('Are you sure you want to
delete # %s?', true), $comment['Comment']['id'])); ?>
On Oct 9, 8:01 am, Fr
Understood. Simple is good.
Yes... you would put the code in your controller and not the view.
Here is a suggestion that you would need to customize to your own
needs:
/* Execute this code before filtering */
function beforeFilter() {
/* Initialize Auth component first from paren
use saveAll()... but why would you want to create a blank profile in
the first place?
On Oct 9, 9:34 am, toneee wrote:
> Hi,
>
> I have 2 controllers so far a users and profiles
>
> They have the usual Index, add, edit and delete functionality.
> Basically the problem i have run into is that whe
Dear Dave,
What I recommend you is to never rely on apache,
do it the cake way...please it is too easy
On Oct 9, 5:41 pm, "Dave Maharaj :: WidePixels.com"
wrote:
> I have the asset helper up and running. Check y-slow and everything gets an
> A except
>
> Grade C on Compress components wit
I have the asset helper up and running. Check y-slow and everything gets an
A except
Grade C on Compress components with gzip
There are 2 plain text components that should be sent compressed
* /styles_typography_125509.css
* jquery_jqueryform_ofl_125509.js
Apache 2.x
@Paul
I've recently been trying NetBeans again and noticed the problems you
describe. On the Mac, installing the latest updates (there were three)
did the job. On Ubuntu, I moved up to 6.8 and that solved it.
@evilbloodydemon
I haven't tried this bundle yet, but when I do I'll report back
On 14
I've seen this before in a couple of my own projects when you've only
specified that 'Post' in your case is containable.
You may also want to check that all models being used in the contain
statement have defined
var $actAs = ('Containable');
Since all your models seem to use containable you may
yep i looked at that its pretty good i'm going to use it but for now i
need a simple sloution like miles j's
whats the good place for this code i tried in view but no luck maybe
controller
if ($comment['Comment']['user_id'] == $this->Auth->user('id')) {
$this->Comment->delete();
}
On Oct 9, 7:
I believe the article has a portion of code that goes in the
applicable model, or even app_model to be available system wide. Then
other code goes in the applicable controller, not the view.
If you implement this, be sure to follow all the instructions. You
need both the Auth and Security compone
I'm using tree behaviour and want to remove a node from the tree
without deleting its children.
I'm having trouble getting this to work. The manual says
'removeFromTree()' and little else. It seems from the few snippets I
googled that it takes id as a parameter. Logical, but does nothing.
The AP
Hello,
my currect application has normal User (Employees) and Company models
among others.
=> Users and companies should be able to login.
Users can manage their account and Companies should be able to manage
their employees (User).
I didn't find a way to check companies- *and* users-table on
yes i did that too
On Oct 9, 2:56 am, Marco wrote:
> Did you set Configure::Cache.check to true in core.php?
>
> Marco
>
> On Oct 8, 1:45 pm, Simon wrote:
>
>
>
> > i tired both
> > element('logininfo', array('cache' => false)); ?>
> > => this dosen't work at all
>
> > in the element i tired w
is this for view or controller if its for view i get error i changed
to my model but this is the error
Fatal error: Call to a member function User() on a non-object in
On Oct 9, 6:02 am, FrederickD wrote:
> There is an interesting article about row-level access here that may
> help too:
>
> htt
Hi,
I have 2 controllers so far a users and profiles
They have the usual Index, add, edit and delete functionality.
Basically the problem i have run into is that when a user adds their
details and successfully registers I want to call the profiles add to
create a blank profile entry in the db. I
There is an interesting article about row-level access here that may
help too:
http://teknoid.wordpress.com/2009/04/22/simplistic-example-of-row-level-access-control-with-auth-security-and-app-model-in-cakephp/
It may generate some other ideas for you too.
On Oct 8, 5:59 pm, Miles J wrote:
> C
I may not understand completely what you are trying to do. I've kept
my boolean elements at tinyint and use something like this with the
views for presentation:
That give a more pleasing visual appearance than a '1' or '0', yet
maintains the database value as boolean.
There is something simila
Hi,
my project needs two different "app" directories.
With Configure::buildPaths(array("controllerPaths" =>
"path_to_directory")) I can use MVC in the second directory. Very
well!
But if I need a list of controllers Configure::listObjects
('controller'); the conrollers of the second directory, t
Hi there,
Summary: when using EmailComponent I bump into a strange problem in
the View class. Using CakePHP 1.3.0.0.
I'm using EmailComponent in a very standard way. In my controller I
have:
$this->Email->to = 's...@email.com';
$this->Email->from = 'some.ot...@email.com';
$this->Email->subject
Hi im working on cakephp
but i trie to do the tutorial for Simple Acl controlled Application
but i have a problem when i put cake bake all on my console i recive
that
PHP Fatal error: ConnectionManager::getDataSource - Non-existent data
source default in C:\wamp\www\cake\1.2.5\cake\libs\model
Thankyou,after all my google searching i found it about 2 minutes
after i posted the message :)
Thankyou for your reply vekija!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group,
Hi Guys,
I wonder if anyone can help?
How would I call an add function in one controller in another
controller?
I have read about request action and how its bad, but now im a little
stuck on how to carry on.
Hope someone can help. Thankyou!
--~--~-~--~~~---~--~~
actually i have been using 0 instead of false or null
works for me
On 8 Okt., 22:03, Miles J wrote:
> Try setting null instead of false, Cake acts weird sometimes with
> "false".
>
> On Oct 8, 12:05 pm, ben wrote:
>
> > I was able to overcome this behavior by setting this in my routes.php
>
> >
usually there is no need to do so
!empty($val) as well as if($val) works on both types the same way
you could easily cast to bool, though:
$x = (bool)$val;
1 => true
0 => false
On 9 Okt., 01:36, Xhaphir wrote:
> Hi,
>
> i have a small problem in cakePHP. I saved a lot of booleans and
> integ
My code:
class Product extends AppModel {
var $name = 'Product';
var $actsAs = array(
'Translate' => array(
'name'));
var $belongsTo = array(
'Category' => array(
'className' => 'Category',
Did you set Configure::Cache.check to true in core.php?
Marco
On Oct 8, 1:45 pm, Simon wrote:
> i tired both
> element('logininfo', array('cache' => false)); ?>
> => this dosen't work at all
>
> in the element i tired which i see no
> debug error even though i set the debug 2
> but when i see
On Oct 9, 1:20 am, "Dr. Loboto" wrote:
> Move $this->images values assign in separate method and call it both
> in getMedia() and getImages(). If I remember right, cake creates new
> controller instance on each requestAction.
>
> On Oct 9, 11:35 am, armen wrote:
>
I was trying to avoid accessi
I'm trying tu use Dardo Sordi MultivalidatableBehavior (http://
bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-
validation-rulesets-per-model).
I have a form where, depending on the value of a field (a select box),
I want to validate one or another field.
The select box is
I have been making a site and testing it on my localhost, but when I have
uploaded it to my real host, it breaks. It is able to load the homepage, but
the images and css files are unable to be found. The error log shows that it
is looking in www.site.com/css instead of www.site.com/app/webroot/css
I'm trying to use Dardo Sordi MultivalidatableBehavior (http://
bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-
validation-rulesets-per-model).
I have a Model with different rules depending on the value of a field
(a select box).
The select box is monitored by ajax->observe
Move $this->images values assign in separate method and call it both
in getMedia() and getImages(). If I remember right, cake creates new
controller instance on each requestAction.
On Oct 9, 11:35 am, armen wrote:
> Hi all,
> I think you can tell I'm a newbie from my question.
> I have a control
Check for whitespace before tags in problem
controller/model files.
On Oct 9, 11:45 am, Jas wrote:
> I have an uploads controller to handle files and it works well apart
> from these two methods:
>
> $this->redirect(array('controller'=>'records','action'=>'view',$this->data['Upload']['record_id
Cache is not for images or any other content. Move them to webroot.
On Oct 8, 10:46 pm, Ziki wrote:
> Hi,
>
> how to view image from cache folder, i have url in database for the
> image, and when i want them view i got error.
>
> I have link like this: /home/hrvatski/public_html/cake/app/tmp/ca
I better keep them all in one table. And have 3 more tables for any
role-special fields.
On Oct 7, 2:02 am, Vijay Pandey wrote:
> Hi !
>
> I am relatively new to cakePHP and I love it for its robustness and
> simplicity... I have got question for experienced programmers.
>
> I am working on a pr
81 matches
Mail list logo