WOW, thank you so much for your very informative answer, Nick! I
nearly gave up all hope already.
I absolutely agree with everything you write. I just don't understand
why the CakePHP developers don't seem to see it "our" way? Why didn't
they tweak SimpleTest so it fits our need with the separate
I placed BaseCase in the root of app/tests/cases
Then in each test case:
I don't have any $import or $records in my inherited classes.
Hope that helps,
Nick
On Sep 15, 8:02 pm, "j.blotus" wrote:
> was there a specific location you dropper your BaseCase file in? or
> any imports that I am
I do something like this:
function isAuthorized() {
if (strpos($this->action,"admin") !== false){
return $this->isAdmin();
}
if (strpos($this->action,"clerk") !== false){
return $this->isClerkOrAdmin();
}
return true;
}
My isAdmin() and isClerkOrAdmin() functions look at vario
Can you test from shell?
$ cd path/to/app
$ cake testsuite app case models/airline
On Sep 15, 5:24 am, web developer wrote:
> I am using cakephp 1.2 and would like to know how to do/use testing in
> cakephp.I went through book.cakephp.org on testing (till model
> testing). I hit a roadblock when
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 in users to id to make sure they
match before the update takes place. This would ensure that the logged
in user is only updating his profile and can't change it to
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 wrote:
> 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 s
Do you have a .required class in your css file?
On Thu, Sep 16, 2010 at 7:04 AM, Dave Maharaj wrote:
> I just baked a new app for testing and right out of the shell (no
> changes just as it comes)
>
>
>
> Went to an add action…I see the red* beside required fields. Good stuff
> maybe I just n
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 cod
Any answers/solutions ???
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" group.
To post to this group, send email to cake-php@googlegroups.com
To
The way I see it, you shouldn't be using classes or methods within the
view, unless its a helper. I'm a bit OCD with some things.
On Sep 15, 7:23 pm, "j.blotus" wrote:
> @milesJ
>
> I guess my point would be that you don't need that overhead of setting
> that extra var in every circumstance, so i
Yeah link() is good for setting it to a variable. But if you just need
a link on the page to direct somewhere, using url() is better imo. You
don't have to deal with Cakes over-zealous escaping and option
handling.
On Sep 15, 7:25 pm, "j.blotus" wrote:
> @milesj
>
> I don't write my links like th
I just baked a new app for testing and right out of the shell (no changes
just as it comes)
Went to an add action.I see the red* beside required fields. Good stuff
maybe I just never noticed it before but now I want that in my real app
beside each required field, check css, html of the new one
@milesj
I don't write my links like that, mainly because I like to assign my
links to a variable, then stuff it into something else. In fact link()
and image() are the only two function I probably would never stop
using if not just from sheer habit. Thanks for chiming in though good
insights.
On
@milesJ
I guess my point would be that you don't need that overhead of setting
that extra var in every circumstance, so it may just be better to call
Configure:: from the view. And just so I understand, what would be
the difference between business logic and templating logic? Are you
saying that
was there a specific location you dropper your BaseCase file in? or
any imports that I am missing?
On Sep 13, 11:52 pm, nurvzy wrote:
> If you use lazy_loading you can get past this, only unit test what
> each model will actually use, instead of having to load all fixtures
> for each because of t
View is for templating logic, not for business logic. It should be
passed down from the controller.
I usually just do this in my beforeFilter().
$this->set('config', Configure::read('foo'));
On Sep 15, 2:06 pm, "j.blotus" wrote:
> @Jeremy
> I would have to disagree about skinny views, because p
I always hated that those functions were even in the HTML helper. It
brings up these questions, but in all seriousness, HTML should be
written as raw HTML.
I hate even using $html->link() this is far better.
Text
On Sep 15, 3:04 pm, "j.blotus" wrote:
> Those are some great points, and I didn't
still having a problem getting the BaseTestCase to work with fixtures.
I made sure to include all of my fixtures in BaseTestCase,
Interestingly, if I do not define fixtures in BaseTestCase, and leave
them defined in my model test case, everything works still, and I see
that inheritence is still wor
How do you write a good isAuthorized function?
My old one pre 1.3 simply read the routing for the specific group
$manage = Configure::read( 'Routing.manage' );
if ( isset( $this->params[$manage]) && $this->params[$manage] ) {
if ( $this->Session->valid() =
EDIT:
Some news.. i've deatached the polymorphic behaviour and the problem
continues...
What can be? that $this->file = $this->find($this->id); inside before save
sometimes returns the same id for Banner and Icon:
class Picture extends AppModel {
var $name = 'Picture';
function beforeDel
Please somebody can help with it? I've provided all scenario, something
wrong with my question?
Att,
Henrique Machado
TI Expert
2010/9/15 Henrique Machado
> Hello everybody!
>
> After a whole day trying to make my application work correctly, asking for
> help on IRC and some friends, I concl
On Wed, Sep 15, 2010 at 6:03 PM, Jeremy Burns | Class Outfit
wrote:
> Speculation... but would $this->referer() help?
That's what I first thought, as it's what Auth::startup() uses:
$controller->redirect($controller->referer(), null, true);
What I did was log out, then click on a known protecte
Those are some great points, and I didn't even think about performance
issues and maintainability for people who don't know the syntax.
On Sep 15, 5:06 pm, Jeremy Burns | Class Outfit
wrote:
> I asked this very question a while back as I was having the same thoughts. I
> started down the path of
Speculation... but would $this->referer() help?
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 15 Sep 2010, at 23:01, cricket wrote:
> In my login() method, how can I check which page the user was on when
> they clicked the login link?
>
> Scenario: The sit
In my login() method, how can I check which page the user was on when
they clicked the login link?
Scenario: The site has paid membership. When the new Member arrives
back at the site from the payment gateway they'll also have received
an email with a password. If the person clicks the login link,
I asked this very question a while back as I was having the same thoughts. I
started down the path of using the helper everywhere but have backed out now
and use pure HTML, except in the odd case. It has to be better from a
performance point of view (why use a helper to generate a simple block,
@Jeremy
I would have to disagree about skinny views, because putting stuff in
the views should help keep clutter out of the controller, which I
think should be as thin as possible. I think it's a bit inefficient to
set a variable in the controller that you could just read statically
in the view, su
I always wondered how everyone else used HtmlHelper to handle html in
their views. I personally have been using a hybrid of raw html for
things like , , , etc because I find it easier to control
the flow of my page and see what's going on. I have been playing
around with HtmlHelper's native tag(),
On Wed, Sep 15, 2010 at 10:34 AM, Celso wrote:
> maybe this:
> http://github.com/cakephp/cakephp1x/commit/9f5949ab5273048c76bf411d7c0057ba217d6132
That narrows it down a bit but what does YOUR code look like? Are you
calling $this->started() somewhere? Note that that's a method of
CakeSession, n
This is just a wild guess, but I would think that doing it the controller is
more efficient than doing it the view? The view is supposed to be as skinny as
possible and only contain layout and flow type logic, rather than application
control.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.c
I've implemented REST routing in cakePHP to properly route REST style
requests to the proper methods in my controller.
This is what I've added to my routes.php
Router::mapResources(array('object_fields'));
This properly routes the REST requests to my index/add/edit/delete
methods inside my contro
I got it worked out... I just realized I was just making a very dumb
mistake.
Incase anyone else needs it, you can use Configure::read('key');
When I tried it, I failed to output... doh. I guess I'm tired. :P
On Sep 15, 3:06 pm, xtraorange wrote:
> Howdy folks,
>
> I'm trying to access a value
sorry...error :D
{{{
print Configure::read("key");
}}}
--
Tilen Majerle
http://majerle.eu
2010/9/15 Tilen Majerle
> Configure::read("value");
> --
> Tilen Majerle
> http://majerle.eu
>
>
>
> 2010/9/15 xtraorange
>
> Howdy folks,
>>
>> I'm trying to access a value via the read method of Con
"Do it in the controller action and pass it down as a variable."that's
second option
--
Tilen Majerle
http://majerle.eu
2010/9/15 Jeremy Burns | Class Outfit
> Do it in the controller action and pass it down as a variable.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> h
Do it in the controller action and pass it down as a variable.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 15 Sep 2010, at 21:06, xtraorange wrote:
> Howdy folks,
>
> I'm trying to access a value via the read method of Configure in my
> layout, but I can
Configure::read("value");
--
Tilen Majerle
http://majerle.eu
2010/9/15 xtraorange
> Howdy folks,
>
> I'm trying to access a value via the read method of Configure in my
> layout, but I can't figure out how to do it.
>
> How do I read a configuration value in the layout?
>
> Thanks,
> James
>
>
Howdy folks,
I'm trying to access a value via the read method of Configure in my
layout, but I can't figure out how to do it.
How do I read a configuration value in the layout?
Thanks,
James
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related q
Tomfox, why do you constantly open 2-3 threads with the same question?
On Wed, Sep 15, 2010 at 9:20 PM, j.blotus wrote:
> you may have to modify that a bit to fit your data structure, i did
> not fully analyze your example
>
> On Sep 15, 2:19 pm, "j.blotus" wrote:
> > foreach ($tmp_attachment
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 wa
Are you sure your data array looks like this?
Array
(
[Article] => Array(
[0] => Array
(
[title] => title 1
)
[1] => Array
(
[title] =
@tilen
That is not any sense.
On Sep 15, 1:36 pm, Tilen Majerle wrote:
> look now...if u want a PROGRAMMING blog...then u should use CakePHP or any
> other framework / script (whatever)
>
> else if u want use a already PROGRAMMED wordpressthen is this not a
> programming
> --
> Tilen Maj
you may have to modify that a bit to fit your data structure, i did
not fully analyze your example
On Sep 15, 2:19 pm, "j.blotus" wrote:
> foreach ($tmp_attachment as $key => $value) {
> $this->data['LinkAttachment'][$key]['filetype'] = $value;
>
> }
>
> that should give you a numeric indexe
foreach ($tmp_attachment as $key => $value) {
$this->data['LinkAttachment'][$key]['filetype'] = $value;
}
that should give you a numeric indexed array that conforms with the
spec in the api:
http://book.cakephp.org/view/75/Saving-Your-Data
saveAll
hope that helps
That would give you a numer
huh, that makes sense :)
this is the array
Array (
[0] => Array ( [LinkTmp] => Array ( [id] => 695 [link_id] => 0 [eyed]
=> 111 [title] => [name] => Gehalt.xslsx [path] => ../link/111/
Gehalt.xlsx [filetype] => xlsx [size] => 22528 [flyer_big] =>
[flyer_thumb] => [qr] => [attachment] => 1 [creat
huh, that makes sense :)
this is the array
Array (
[0] => Array ( [LinkTmp] => Array ( [id] => 695 [link_id] => 0 [eyed]
=> 111 [title] => [name] => Gehalt.xslsx [path] => ../link/111/
Gehalt.xlsx [filetype] => xlsx [size] => 22528 [flyer_big] =>
[flyer_thumb] => [qr] => [attachment] => 1 [creat
look now...if u want a PROGRAMMING blog...then u should use CakePHP or any
other framework / script (whatever)
else if u want use a already PROGRAMMED wordpressthen is this not a
programming
--
Tilen Majerle
http://majerle.eu
2010/9/15 LunarDraco
> True that there is additional mainte
I have tried the same on Mac OSX with snowleopard nothing changed.
Ideas?
On 15 Set, 09:02, AD7six wrote:
> On Sep 15, 8:43 am, "Mariano C." wrote:
>
>
>
> > On 14 Set, 22:10, AD7six wrote:
>
> > > On Sep 14, 10:09 pm, AD7six wrote:
>
> > > > On Sep 14, 7:41 pm, "Mariano C." wrote:
>
> > > >
emm...manual is in core.php before
{{{
Configure::write("debug", 0);
}}}
--
Tilen Majerle
http://majerle.eu
2010/9/15 psybear83
> Thank you! Where is the manual you mention? I'm sorry, I don't really
> understand what manual you exactly mean...
>
> On Sep 15, 4:27 pm, Tilen Majerle wrote:
>
Try using:
Router::connect('/account/profile/*', array('controller' => 'users',
'action' => 'profile'));
No you cant stop them from going to /users/profile that I know of. Why
don't you just change the users controller to account?
On Sep 15, 4:34 am, Trent wrote:
> I have the following route:
>
When you do find 'all', it returns the array in a numeric index, when
you do find 'first' it returns a single item with no numeric index.
When you omit parameters, I believe it defaults to 'first'.
So the answer is you need to look at how the array you are trying to
work with is formatted.
print_
as soon as I abandon the 'all' paramter in my find() function, cake
stops throwing this error.
but i need 'all' because i am expecting multiple entries
On 15 Sep., 18:50, Tomfox Wiranata wrote:
> hi.
>
> I have two Models LinkTmp and LinkAttachment, hence two tables. these
> two models have no r
hi.
I have two Models LinkTmp and LinkAttachment, hence two tables. these
two models have no relation at all, since the LinkTmp is just for
temporary storing, till the User finally saves his product.
I want to save data from LinkTmp in LinkAttachment. Its nothing else
than copying the data from
Really great insights on the subject. I am going to skip lazy loading
for the app in question because I don't want to introduce any new
potential issues, but for the next app I am going to use it for sure.
I will double check my fixtures array, they are getting inherited, but
I must have missed on
True that there is additional maintenance, and documentation required.
Which I believe is worth it.
However I would argue that I and many developers in the past have
tried to force a single platform/language/db etc. The reality is we
(and our clients) cannot afford to rewrite everything using our n
Fixtures in WebTestCase?
http://book.cakephp.org/view/1219/Web-testing-Testing-views#About-CakeWebTestCase-1220
Short answer: Nope.
Long answer: Eventhough you can't use fixtures, you can still make
your app use a secondary database instead of your production one.
This is not a CakePHP solution,
thanks! Another case of read the manual first... :(
thanks again!
On 15 Sep, 16:23, Andras Kende wrote:
> http://book.cakephp.org/view/1433/textarea
>
> Andras Kendehttp://www.kende.com
>
> On Sep 15, 2010, at 10:38 AM, james wrote:
>
> > Hi is it possible to make an input multiline? For eg with
http://book.cakephp.org/view/1433/textarea
Andras Kende
http://www.kende.com
On Sep 15, 2010, at 10:38 AM, james wrote:
> Hi is it possible to make an input multiline? For eg with an address
> field?
>
> cheers!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
>
hi andrei,
i am using saveAll but it is still saving just the first result...
On 15 Sep., 15:31, Andrei Mita wrote:
> I don't know if I got it right but saveAll might help. Take a look
> here:http://book.cakephp.org/view/1031/Saving-Your-Data
>
> On Wed, Sep 15, 2010 at 4:21 PM, Tomfox Wiranata
Thank you! Where is the manual you mention? I'm sorry, I don't really
understand what manual you exactly mean...
On Sep 15, 4:27 pm, Tilen Majerle wrote:
> You need to set debug to 0 in APP/config/core.php ... look manual at this
> file about debug... :D
>
> --
> Tilen Majerlehttp://majerle.eu
>
Hi is it possible to make an input multiline? For eg with an address
field?
cheers!
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" group.
To pos
maybe this:
http://github.com/cakephp/cakephp1x/commit/9f5949ab5273048c76bf411d7c0057ba217d6132
On 14 set, 20:51, cricket wrote:
> On Tue, Sep 14, 2010 at 5:19 PM, Celso wrote:
> > Fatal error: Call to undefined method UsersController::started() in /
> > srv/www/htdocs/libs/cake/libs/session.ph
You need to set debug to 0 in APP/config/core.php ... look manual at this
file about debug... :D
--
Tilen Majerle
http://majerle.eu
2010/9/15 psybear83
> Hi everybody
>
> I have baked CRUD for my Users controller, but it seems that the
> generated code is buggy...?!
>
> As to my understandi
Hi everybody
I have baked CRUD for my Users controller, but it seems that the
generated code is buggy...?!
As to my understanding, $this->flash(...) should redirect to the page
specified in the supplied 2nd argument.
But whether my add nor my edit actions redirect - they just show a
blank page
It sounds like you just need to use a custom session handler to
maintain Auth data between subdomains. This is pretty easy:
http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session-handling-to-your-needs
On Sep 15, 5:15 am, DigitalDude wrote:
> Hey,
>
> I have an app which is divided
I don't know if I got it right but saveAll might help. Take a look here:
http://book.cakephp.org/view/1031/Saving-Your-Data
On Wed, Sep 15, 2010 at 4:21 PM, Tomfox Wiranata
wrote:
> hi,
>
> I have a find() method that will find return multiple results from my
> table:
>
> $tmp_attachment = $this
hi,
I have a find() method that will find return multiple results from my
table:
$tmp_attachment = $this->LinkTmp->find(array('LinkTmp.cat ' => $this -
> Session -> read('Link.cat'), 'LinkTmp.attachment' => '1'));
now i now, that i can save the result like this
$this->data['LinkAttachment']['f
I have the following route:
Router::connect('/account/profile', array('controller' => 'users',
'action' => 'profile'));
When I am on /account/profile and save without having a first name it
shows an error on the page and the url in the browser has changed to /
users/profile/15. How can I stop thi
I am using cakephp 1.2 and would like to know how to do/use testing in
cakephp.I went through book.cakephp.org on testing (till model
testing). I hit a roadblock when i tried model testing.
This is what i did
A. Downloaded simpletest and added it in vendors folder
B. Created test connection in da
Hello,
In my application, i have a model named Privacy who define if a user
can access or not to an element.
For the moment, i've created a function in my AppController who
returns me all the conditions to retrieve only the elements that the
user can see.
I want to simplify this method. I've tri
hi,
I have a find() method that will find return multiple results from my
table:
$tmp_attachment = $this->LinkTmp->find(array('LinkTmp.cat ' => $this -
> Session -> read('Link.cat'), 'LinkTmp.attachment' => '1'));
now i now, that i can save the result like this
$this->data['LinkAttachment']['f
big thx :)
On 15 Sep., 13:39, Zaky Katalan-Ezra wrote:
> Yes you can.
> You should also write a function that clean you tmp data.
> This function should run on schedule (cron) in order to delete orphan
> attachments.
> If the user selected attachments but didn't click the save button and the
> cl
Yes you can.
You should also write a function that clean you tmp data.
This function should run on schedule (cron) in order to delete orphan
attachments.
If the user selected attachments but didn't click the save button and the
cleaup code didn't run as expected.
Check out the new CakePHP Question
yes that is what i try to solve. but i use jquery.
so i can just write plain sql in a function``?
On 15 Sep., 12:18, Zaky Katalan-Ezra wrote:
> 1. You can use only tmp_attachments and call sp_movefromtemp(post_id) when
> the user click the save button.
> In the stored procedure execute the sql y
I think you need to use something like openID or implement centralize
user/session management for all your apps.
app/dashboard and backend.app/dashboard is the same domain and a different
sub domain.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP rel
1. You can use only tmp_attachments and call sp_movefromtemp(post_id) when
the user click the save button.
In the stored procedure execute the sql you wrote and cleat tmp table.
2. You can also use boolean tmp flag in attachments table.
What problem do you try to solve with this approach? Loading
I guess most people would just have admin actions in their existing controllers
rather than trying to do it through a sub-domain.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 15 Sep 2010, at 10:37, DigitalDude wrote:
> Hey,
>
>
> I am using the Auth com
Hey,
I am using the Auth component, but regularly I redirect to a page
within the current domain (which would be http://app/dashboard) but I
need to redirect to http://backend.app/dashboard). That would be a
different controller and I don't know how to tell cake that a logged
in user from the fro
Is there a reason why you are you not using the Auth component and admin prefix
routing?
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 15 Sep 2010, at 10:15, DigitalDude wrote:
> Hey,
>
>
> I have an app which is divided into a front- and a backend. I'm
Hey,
I have an app which is divided into a front- and a backend. I'm using
the same models in the frontend, but controllers are strictly
divided.
What I'm trying to do is make a login-element into the frontend where
admins can login, and will be redirected to the authed area in the
backend. So f
I would look into the afterSave model function. Just a guess, but you'll
probably need to do a find on the tmp table (perhaps into a variable called
$tmp_results), then do a $this->Attachment->saveAll($tmp_results) and finally a
deleteAll on AttachmentTmp.
Jeremy Burns
Class Outfit
jeremybu...
Hi,
I have a table in my database that stores information temporarily,
during a page creation process.
table :attachment_tmps
attributes: id, product_id, name, path, size, attachment
when the user hits finally the "save" button i want to write the
information from the tmp table to the real one,
Sorry that was stupid - sorry for wasting your time!
On Sep 14, 6:17 pm, cricket wrote:
> You have a route for '/simulations/get/' but not '/simulations/get/*'
> so Router is choosing the last one, '/simulations/*' which points to
> 'view'.
>
>
>
> On Tue, Sep 14, 2010 at 6:30 AM, Felix wrote:
I'll give it a shot:)
Thanks a lot!!!
On 14 Sep., 23:00, Miles J wrote:
> You need to wrap it in quotes, since it is a string.
>
> requestDelete('')
>
> On Sep 14, 10:35 am, Tomfox Wiranata
> wrote:
>
> > Hey,
>
> > this is a JQuery function i want to call when clicking the button:
>
> >
>
thx dave...i appreaciate your help :)
i switched to a 100% Jquery and made it work somehowi needed to
initialize JQuery again, as soon as I reloaded a div...thats why it
did not work and i had to try the ajax thinganyway...
thank you
On 14 Sep., 17:08, "Dave Maharaj" wrote:
> Ok if I am
On Sep 15, 8:43 am, "Mariano C." wrote:
> On 14 Set, 22:10, AD7six wrote:
>
>
>
> > On Sep 14, 10:09 pm, AD7six wrote:
>
> > > On Sep 14, 7:41 pm, "Mariano C." wrote:
>
> > > > this post suggest to modify server setting. I'm not the server admin,
> > > > I can't modify it. Can I handle this b
85 matches
Mail list logo