Hello,
I'd like to be able to have my Schema file import some data from a CSV file
into one of my tables. This way I don't have to manually import my data
into my table after running my schema file.
I know how to insert data into my table using Schema, but I don't know how
to get it to read
Hello,
I'd like to be able to know if someone is directly accessing images from my
/webroot/img directory. Is this possible?
For instance if they type in: http://mydomain/img/picture.jpg
I should be able to check for this in my beforeFilter like I can for my
actions, but it doesn't seem to
Hello,
I have a method called init_logger() in my Plugin's LoggerAppController
which does a redirect. And I want to call the init_logger() method from
my main applications AppController. But when I call my init_logger()
method I get the error message call to member function header() on non
For instance I have a plugin called Logger. And inside of my Logger plugin,
I want to use the Recaptcha plugin but I want it contained inside of the
Logger plugin.
When I try to load the plugin from within my Loggers bootstrap though it's
not looking inside my /app/Plugin/Logger/Plugin
Hello,
My associated model validation for Uploads(MeioUpload) while saving
multiple model associations at once does not work.
I'm using the MeioUpload plugin for uploading files. Each Upload is related
to a News with a one to many relationship. When I try to save an Upload at
the same time
plugin and when I fixed the above errors the validation wouldn't
allow .doc .pdf through and that was because I didn't include the period
along with the allowed extensions.
Solved.
Andrew
On Thursday, September 6, 2012 1:39:42 PM UTC-7, andrewperk wrote:
Hello,
My associated model validation
Hello,
I'm having a hard time getting data from the database to display in Google
Charts. I want to just display the datetimes(last_usage_human) for my
entries as a line chart.
I first just find my data, then I format it so I can pass it as json to the
charts:
// Grab all the data
/1072546230
And here is controller function
http://bin.cakephp.org/view/1812101735
I hope it will help
Dana srijeda, 5. rujna 2012. 21:03:52 UTC+2, korisnik andrewperk napisao
je:
Hello,
I'm having a hard time getting data from the database to display in
Google Charts. I want to just
I do this:
?php
// Loads in the TestController from the Test plugin Controller package
App::uses('TestController', 'Test.Controller');
class AppController extends Controller {
public function beforeFilter() {
// Instantiate the TestController
// Call your method
Hello,
When trying to do a DISTINCT find with only 1 field being returned
everything works fine. But if I want more than just that 1 field of data
returned it's no longer distinct. How can I do this?
$DistinctIp = $this-Log-find('all', array(
'conditions'=array(
'last_usage_human '=date('Y-m-d
:20 PM UTC-7, andrewperk wrote:
Hello,
When trying to do a DISTINCT find with only 1 field being returned
everything works fine. But if I want more than just that 1 field of data
returned it's no longer distinct. How can I do this?
$DistinctIp = $this-Log-find('all', array(
'conditions
Hello,
I need to be able to print out some data from my database such as:
SHOW FULL PROCESSLIST
SHOW GLOBAL STATUS
SHOW GLOBAL VARIABLES LIKE 'hostname'
etc..
How can I accomplish this? What I've been trying to do is use the query()
method in a model to run my own custom query but that's not
Hello,
I'd like to be able to ensure that the table CakeSchema create's is a
memory heap. How can I set the storage engine for a table created using
CakeSchema?
I tried something like this:
public $sucker_log = array(
'id'=array('type'='integer', 'null'=false, 'default'=null,
I figured out. Just in case someone else wants to know this:
'tableParameters' = array('engine' = 'MEMORY')
On Thursday, August 23, 2012 10:14:50 AM UTC-7, andrewperk wrote:
Hello,
I'd like to be able to ensure that the table CakeSchema create's is a
memory heap. How can I set the storage
Hello,
I've created a plugin which handles authentication(using Auth component)
for my projects. The plugin authentication works inside of the plugin
itself but it does not authenticate or protect any of my controller/actions
outside of the plugin.
For instance my plugin:
/app/Plugin/Logger
Muka, you are correct, it was just a copy/paste from some of my code and I
changed somethings to Choice but forgot to change the $this-Article
On Wednesday, March 14, 2012 12:57:41 AM UTC-7, muka wrote:
Il 14/03/2012 08:07, andrewperk ha scritto:
Whenever I want to access a tables data from
Whenever I want to access a tables data from another controller that
doesn't have a relationship with the other table I use:
class MyController extrends AppController {
public function action() {
App::uses('Choice', 'Model');
$this-Article =
and $this-contents are always null as well when using redirect.
On Saturday, March 10, 2012 7:56:37 PM UTC-8, andrewperk wrote:
Hello,
I have a couple of questions about testing certain things:
Flash Messages: I know how to test that the setFlash method has ran
using mocks
mock.
This may help someone some day.
On Saturday, March 10, 2012 7:56:37 PM UTC-8, andrewperk wrote:
Hello,
I have a couple of questions about testing certain things:
Flash Messages: I know how to test that the setFlash method has ran
using mocks, but is there a way to verify
Hello,
I have a couple of questions about testing certain things:
Flash Messages: I know how to test that the setFlash method has ran
using mocks, but is there a way to verify that it contains the correct
message?
assertTags() Views: I use testAction to return the view then use
assertTags to
I run Linux Mint and I also have xamp installed and to get things
working properly with cake I've had to install a couple of other
packages.
sudo apt-get install php5-cli
sudo apt-get install php5-mysql
On Mar 6, 12:28 pm, Daniel Carrillo Broeder dcbroe...@gmail.com
wrote:
Hi, i'm having lots
Also, by any chance maybe you didn't start xamp?
From the command line:
sudo /opt/lampp/lampp start
To stop it:
sudo /opt/lampp/lampp stop
Of course if you installed xamp somewhere else you'll need to navigate to
the appropriate location before starting it. Mine is under /opt/lampp
Andrew
schrieb andrewperk:
debug=1 does not work when testing controllers with the testAction
method using the web runner.
If you call the testAction method any debugs do not work. If you
remove the testAction method call it works again and prints out your
debug just fine.
--debug
Hello, in the past during one a test case I used to be able to call
the debug method and it would output the data on to the testing web
runner and display the information like so:
function testSomething() {
$result = 'My result';
debug($result);
}
This does not work now. I can't seem to figure
Not even 5 seconds after I make this post I see that I should put
debug=1 in the URL because the tests swallow output. Sorry.
On Mar 5, 8:55 pm, andrewperk andrewp...@gmail.com wrote:
Hello, in the past during one a test case I used to be able to call
the debug method and it would output
with testAction so you can
use that instead.
Anyone know how to get debug to work with ControllerTestCase and
testAction?
Thanks.
On Mar 5, 9:00 pm, andrewperk andrewp...@gmail.com wrote:
Not even 5 seconds after I make this post I see that I should put
debug=1 in the URL because the tests swallow
Is the $formulaId being passed in through the URL?
If so, I believe that the $formulaId variable is only available in
your action when the page is first requested via the get request. Once
the page is submitted with the form and it's doing a post request it
no longer has $formulaId being passed
Hello, I have a Post model with each Post can have many Comments and
each Comment belongs to a Post.
What I'm trying to do is select only Posts which have 5 more comments
using Pagination.
I'm confused on how to construct this query and how to do it using
Pagination. I know I need to get a count
I made a typo in the 2nd paragraph. I meant:
What I'm trying to do is select only Posts which have 5 or more
comments using pagination.
On Feb 7, 3:22 pm, andrewperk andrewp...@gmail.com wrote:
Hello, I have a Post model with each Post can have many Comments and
each Comment belongs to a Post
Hello,
I'm using the CakeDC search plugin.
How can I search with a Like query in two different fields in the
database using just one form field?
For instance, a user goes to the form, enters in their search term,
this term will be checked if there's a Like query match in both the
entry1 field
('Model1.entry1', 'Model1.entry2',
'Model2.entry2', ...)
On 22 Jan., 19:46, andrewperk andrewp...@gmail.com wrote:
Hello,
I'm using the CakeDC search plugin.
How can I search with a Like query in two different fields in the
database using just one form field?
For instance
This looks perfect Jeremy. Thanks!
On Jan 11, 6:54 am, jeremyharris funeralm...@gmail.com wrote:
Try something like this: https://github.com/jeremyharris/cacher
It's a plugin I wrote that caches query results, exactly as you want.
--
Our newest site for the community: CakePHP Video
Hello,
I would like to be able to run a database query, but I only want the
query ran once per day. Then store the results from that query maybe
in a session or a cookie?
I want to do this in order to reduce the amount of database calls when
the page is refreshed.
Does anyone have any tips on
Hello, I'm having a hard time displaying different text in a view
depending on if a user who is logged in has marked the post as a
favorite or not.
Users can have many posts, posts belong to users.
Users can have many favorites, favorites belong to users and posts.
In my index view I loop
Hi Mamdoohi,
As others have said when you call your models save() method it will
check validation by default. But if for whatever reasons you want to
do manual validation, here's a few methods that I found extremely
helpful:
$this-YourModel-set($this-request-data);
You can use your models set
/
PostsController.php(121): AppController-_send_email('send_to_friend',
'html', 'andrewperk@gmai...', 'newvenuswebsite...', 'James has
sent ...', Array)
#5 [internal function]: PostsController-stf()
#6 /home/content/76/5924776/html/lib/Cake/Controller/
Controller.php(473): ReflectionMethod-
invokeArgs(Object
I also had trouble using tinymce. I then tried yui's rich text editor
and ran into a lot of styling issues and conflicts.
Finally I found ckeditor: http://ckeditor.com/. It works flawlessly
for me and is very easy to integrate, like 4 steps total.
1. Just download and put the ckeditor folder
' = -1,
'conditions' = $conditions,
Andras Kendehttp://www.kende.com
On Oct 29, 2011, at 1:27 PM, andrewperk wrote:
Hello,
I've implemented a user model and I have a simple search form for
searching by gender, age, location. I'm using the paginator
Hello,
I've implemented a user model and I have a simple search form for
searching by gender, age, location. I'm using the paginator to
paginate the results. The problem is that it's only remembering the
search criteria on the first page. When I click on page 2, or next
etc.. It defaults back to
my php.ini include_path to also include the /usr/share/
php directory and it works!
Thanks again.
Andrew
On Oct 25, 9:10 am, mark_story mark.st...@gmail.com wrote:
I would check that php's include_path includes the path that PHPUnit
was installed into.
-Mark
On Oct 24, 4:23 pm, andrewperk
Hello,
I have PHPUnit 3.5.15 installed on Linux, PHP 5.3.5, it was installed
using the pear installer per the directions in the cake 2.0 book.
When I browse to localhost/myapp/test.php, cake tells me PHPUnit is
not installed. It tells me to run some commands to install it. So I
tried running
Thanks Euromark, I'll give that a try..
On Oct 24, 2:35 pm, euromark dereurom...@googlemail.com wrote:
I dont install it at all and just drop the necessary files in /vendors
works like a charm :)
On 24 Okt., 22:23, andrewperk andrewp...@gmail.com wrote:
Hello,
I have PHPUnit
just fine.
Thanks for any help.
On Oct 24, 2:35 pm, euromark dereurom...@googlemail.com wrote:
I dont install it at all and just drop the necessary files in /vendors
works like a charm :)
On 24 Okt., 22:23, andrewperk andrewp...@gmail.com wrote:
Hello,
I have PHPUnit 3.5.15 installed
I thought I would respond back to this in case someone else had the
same problem. I fixed it by changing my host in my Config/database.php
file to be 127.0.0.1 instead of being localhost.
Andrew
On Oct 4, 2:02 pm, andrewperk andrewp...@gmail.com wrote:
Well it turns out it did not fix
Your model's save method doesn't actually return a boolean, you can
just use the method call itself in a conditional, but it actually
returns an array. You could check if $updated is not empty I believe:
if (!empty($updated)) {
}
Or use the method call itself in a condition to see if the save
I may have said that wrong, I think it returns two different things,
if successful it will return an array if not I believe it just returns
false.
On Oct 8, 4:58 pm, andrewperk andrewp...@gmail.com wrote:
Your model's save method doesn't actually return a boolean, you can
just use the method
If your model has an association with the other model that you want to
retrieve from, each time you do a find it will also retrieve any
associated data as well. You can read about it here:
http://book.cakephp.org/view/1039/Associations-Linking-Models-Together
You can also use App::import. For
?php endforeach; ?
This is how it should be, no indentation inside the php loop:
?php foreach(): ?
p
a href=indexUser 1/a
/p
?php endforeach; ?
On Oct 7, 10:24 pm, andrewperk andrewp...@gmail.com wrote:
How can I test my view's html that have formatting(line breaks,
indenting) using
How can I test my view's html that have formatting(line breaks,
indenting) using assertTags? Here's the problem I'm running to:
When I create html like this inside one of my views:
p
a href=indexUser 1/a
/p
And then run the assertTags method like so:
$this-assertTags($result, array(
ShellDispatcher::ShellDispatcher() - CORE/cake/console/cake.php, line
139
[main] - CORE/cake/console/cake.php, line 666/pre/div/preYour
database does not have any tables.
On Oct 3, 10:09 am, andrewperk andrewp...@gmail.com wrote:
Thanks you guys, that fixed it.
On Sep 27, 4:43 am, LipeDjow liped
Thanks you guys, that fixed it.
On Sep 27, 4:43 am, LipeDjow liped...@gmail.com wrote:
Also check if php5-mysql is enabled for the php CLI.
LipeDjow
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site
Hello, I'm trying to get Bake to work on Linux. Cake works fine except
for baking.
I'm on Ubuntu 11.04
xampp 1.7.4 for Linux
I have php5-cli installed
When I run the command, from:
/opt/lampp/htdocs/cakeapp/cake/console
./cake bake
and then if I try to bake a model I get a fatal error:
PHP
Hello,
I'm wondering how to keep my cake files in sync while working in a
group with others. I understand how to use git and I've been using it
solo for versioning my applications. Then I just use Filezilla to FTP
my files into my remote server.
This will be difficult to do in a group though as
(null, $id);
}
$users = $this-Profile-User-find('list');
$this-set(compact('users'));
}
Would be very grateful if you can edit it to include what you wrote
initially.
Thanks
On Sep 3, 5:12 am, andrewperk andrewp...@gmail.com wrote
I gave you an answer to both of your questions in your previous
thread. I even gave you the full code to do so.
On Sep 3, 5:44 am, tubiz tayi...@gmail.com wrote:
I have a User and Profile controller in an application I am working
on.In my model files a User hasOne profile and a Profile
the function to be displayed
to a user that has logged in and hasnt setup his profile but if he has
set it up he should be directed to the Users Homepage.
On Sep 3, 5:48 pm, andrewperk andrewp...@gmail.com wrote:
It's pretty simple, just use a conditional to compare the logged in
user's ID
You need to scope the update to only update the logged in user. That
way when a user accesses the update action it will only allow them to
update their own account.
For instance on the action to update a user fetch that user like so:
public function update() {
// This sets the logged in user
table.
It is possible you have a form somewhere in your app for a model that
is related to User, but are not including User.id field in the form.
If so when you update that record using this form it will create a
blank record in the User table.
HTH, Paul.
On Aug 19, 2:56 am, andrewperk
I use 1and1 as well and I found that I need to include a forward slash
and define where the app folder is as well in the path. My cake app is
installed in my root folder.
Here's my root .htaccess:
IfModule mod_rewrite.c
RewriteEngine on
RewriteRule^$ /app/webroot/[L]
RewriteRule
Also, this is not happening locally when I develop.
I would think if I had a form somewhere creating blank users it should
happen locally as well. This is only happening on my remote server.
I don't know how to fix this. =(
On Aug 19, 9:46 am, andrewperk andrewp...@gmail.com wrote:
Hi WebbedIT
.
It is possible you have a form somewhere in your app for a model that
is related to User, but are not including User.id field in the form.
If so when you update that record using this form it will create a
blank record in the User table.
HTH, Paul.
On Aug 19, 2:56 am, andrewperk andrewp
it, as I'm not sure where the error might lie.
Thanks for any help.
On Aug 13, 8:57 am, euromark dereurom...@googlemail.com wrote:
yes, withsecuritycomponent this is not possible.
but ceeram is right about the password displayed.
On 13 Aug., 01:13, andrewperk andrewp...@gmail.com wrote
Hi, by default the Auth component needs to be configured in your
UsersController. Your users controller only needs to have 2 actions.
function login() {
}
You can leave the login action blank as the Auth component handles the
rest. You just need a view for the login action.
function logout() {
about the Auth config in each different
controller that needs different options, for instance you may want to
deny certain actions in one controller but not in another. I hope
that's clearer.
On Aug 16, 9:22 pm, andrewperk andrewp...@gmail.com wrote:
Hi, by default the Auth component needs
Hello,
I'm using the Js helper and its submit() method to do an Ajax
submission. Why on the first submission does it do an ajax submission
correctly, but on on a second submission after it re-displays the form
with validation errors it does a full page refresh rather than doing
an ajax
Hello,
I have a cakephp site I'm working on. I have it live on a production
server, it's still in development.
I switched my core.php from production to development to do some
testing of things on the live server and forgot to change it back. I
left it like this for about a week.
Apparently
with nonsense).
@seehttp://www.dereuromark.de/2010/09/21/saving-model-data-and-security/
for details
On 12 Aug., 22:24, andrewperk andrewp...@gmail.com wrote:
Hello,
I have a cakephp site I'm working on. I have it live on a production
server, it's still in development.
I switched my core.php
The username and password is specific to just that database luckily.
I've changed the information. Thanks Ceeram.
On Aug 12, 3:51 pm, Ceeram c33...@gmail.com wrote:
with debug on, and there is an error with db connection, it will show db
login credentials (this is changed in latest versions),
Thank you Ryan and Jeremy.
You were right the conditional I used in the view to check if they
were subscribed was stale. I got it working. Initially in my app
controller I was checking if they were subscribed like this:
// returns true if not subscribed
protected function isNotSubscribed() {
Hello,
I'm using Webtechnicks Paypal Plugin. It works great. After someone
pays and if the transaction was completed in my application I update
the user and mark them as a subscribing customer.
However they have to logout then log back in before it actually takes
effect for them. If, after they
into the association via a
findByAll?
On Jun 28, 4:59 pm, andrewperk andrewp...@gmail.com wrote:
Hello, I'm trying to figure out how to limit my find query to a field
that is in the related table. My associations are like so:
User hasMany Message
Message belongsTo User
User hasOne Avatar
Avatar
Hello, I'm trying to figure out how to limit my find query to a field
that is in the related table. My associations are like so:
User hasMany Message
Message belongsTo User
User hasOne Avatar
Avatar belongsTo User
In my Message model, I'm finding all messages that belong to a user.
I'm using a
I use redcar. You'll need ruby installed to install redcar as a gem
but its a fantastic text editor. It's very similar to textmate, it has
lots of bundles, snippets, and all of the popular textmate themes.
On Jun 19, 6:27 pm, Robert sigz...@gmail.com wrote:
What editor or IDE do you find has the
which is why I was not receiving an error. It
was just flagging the answer as spam and not displaying it after the
page refresh. Problem solved.
Thanks again.
On Feb 15, 3:25 pm, Ryan Schmidt google-2...@ryandesign.com wrote:
On Feb 15, 2011, at 13:41, andrewperk wrote:
I'm trying to save
Hello,
I'm trying to save a block of german text into my application. It
allows users to ask questions and users to answer. Most of the website
is in german. The database charset is utf-8 and collation is
utf-8_general_ci.
My application saves most german just fine to the database. But when
to the database.
On Feb 15, 11:41 am, andrewperk andrewp...@gmail.com wrote:
Hello,
I'm trying to save a block of german text into my application. It
allows users to ask questions and users to answer. Most of the website
is in german. The database charset is utf-8 and collation is
utf-8_general_ci
Hello, I'm trying to get my application to use a different language
using cake's i18n. I believe I have my application set up properly.
core.php
Configure::write('Config.language', 'ger');
Posts Controller Flash message:
$this-Session-setFlash(__('You must be registered before you can ask
a
I don't think so. Are you just using:
var $scaffold;
in your controllers? You would have to bake out the scaffolded views
and just make your changes to your views/controller_name/index.ctp
file.
On Sep 21, 2:27 am, psybear83 psybea...@gmail.com wrote:
Hi all
Instead of
Show - Edit - Delete
I've been jEdit as well. It's really nice once its setup. It works a
lot like textmate does. You can convert all textmate themes to jEdit
themes using tm2jed. The scheme plugin allows you to change your theme
or scheme, buffer tabs lets you have your files tabbed at the top,
superabbreves gives
/view/1296/Security-Component
On Sep 17, 8:05 am, Andrei Mita andrei.m...@gmail.com wrote:
I believe that is true. You can test this by opening the page with FF, alter
the form with firebug and submit it.
On Thu, Sep 16, 2010 at 9:38 PM, andrewperk andrewp...@gmail.com wrote:
Thanks
profile number? Thanks.
On Sep 16, 8:26 am, cricket zijn.digi...@gmail.com wrote:
On Thu, Sep 16, 2010 at 2:41 AM, andrewperk andrewp...@gmail.com wrote:
Thanks for responding Andrei,
I didn't think I was submitting the user's ID. I thought I was just
comparing the users id to the logged
Hello,
(my users edit action is below)
What I'm wondering is if there's any way a user could make their own
form and submit it to this action and update someone elses profile?
I've seen that even though in my view I have the form submitting to my
users controller and edit action, in my source
action=users/edit/6 even though my users edit action
doesn't take an ID as a parameter. Thanks.
On Sep 15, 11:30 pm, Andrei Mita andrei.m...@gmail.com wrote:
Why do you need to submit the user's id and check it against the logged user
id?
On Thu, Sep 16, 2010 at 9:00 AM, andrewperk andrewp
Thanks for your help guys. But, I actually just made a simple typo. On
my page that displays both forms I accidentally named my input field
'User.name' instead of 'User.username'. So it couldn't submit
properly. My login view that had the login form alone worked just fine
because the input field
Hello,
I'm having trouble with my login and register forms being on the same
page. When I try to login on my index page where both forms are
displayed at once it says my username and password are incorrect after
redirecting me to the actual login view page where I display only the
login form. If
Hello,
I have a users table with a role field. When a user logs in the cAuth
component stores that users info inside of:
$session-read('Auth.User.role')
Then inside of my view I can do something like this:
?php if ($session-read('Auth.User.role') == 'administrator'): ?
pYou are an
(I somehow hit tab+enter and submitted my post before I was finished,
I'm sorry for the double post).
Hello,
I have a users table with a role field. When a user logs in the Auth
component stores that users info inside of:
$session-read('Auth.User.role')
Then inside of my view I can do
Is there a way to target a specific controller from within the
AppController?
For instance inside of controllers I can do this:
if ($this-action == 'index')
{
// do something
}
to target a specific action.
Is there something similar to this for inside of the AppController to
target a
88 matches
Mail list logo