Hi,
I agree that data cleaning and sanitization is best kept out of the
controller and in the model. However, before I present my solution and
for the sake of completeness, there are two functions,
sanitize::paranoid and sanitize::cleanArray that work from the
controller. I and others have found
in the posts_controller.php file, I have a function called funcation
add() to add new posts. inside add function, i want to call another
function checktags(), where do i write this function. I place it in
the posts_controllers.php file, and get this error message.
Fatal error: Call to
I'm fairly new here (except that I did lurk in the early stage).
I'd like to know if 1.2 is really ready? I don't seem to find good
plugins/articles based on 1.2. TIA.
--
?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
hello feelexit
Are you calling your function like this?
function checktags() {
return 'Bravo!';
}
function add() {
$retVal = $this-checktags();
}
-Messaggio originale-
Da: cake-php@googlegroups.com
[mailto:[EMAIL PROTECTED] Per conto di feelexit
Inviato: lunedì 26 marzo
hi, M. thanx.
I am using
echo checktags(); this gives me error.
after I change it to
echo $this-checktags();
it works now.. thanx alot.
On Mar 26, 6:02 pm, [EMAIL PROTECTED] wrote:
hello feelexit
Are you calling your function like this?
function checktags() {
return 'Bravo!';
You can use a hack to format the tags using an indice ... such as
['model'][0]['Name'], ['model'][1]['Name] etc ...
You can use : 'Model/'.$indice.'][fieldname' into the tag name to
produce the above format ..
On Mar 26, 5:37 am, cc96ai [EMAIL PROTECTED] wrote:
I know how to do in PHP,
but I
Just check it.. you'll love it.
http://www.e-texteditor.com/
While i was waiting InType to gain some speed and development i found
e-texteditor which saved my day :P
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
What a timely post! I'm doing the same thing...showing a table of data
and allowing the user to edit it. By using this 'hack' will CakePHP
handle the insert without any additional considerations?
--~--~-~--~~~---~--~~
You received this message because you are
Hi
I installed phpmailer
Calling it like the tutorial says:
vendor('phpmailer/class.phpmailer');
And then error:
Call to undefined function: addaddress() in /usr/www/users/struts/cake/
app/controllers/hunters_controller.php on line 37
line 37:
$this-Mailer-AddAddress('[EMAIL PROTECTED]');
Is $this-Mailer an instance of class.phpmailer??
2007/3/26, Enchy [EMAIL PROTECTED]:
Hi
I installed phpmailer
Calling it like the tutorial says:
vendor('phpmailer/class.phpmailer');
And then error:
Call to undefined function: addaddress() in /usr/www/users/struts/cake/
You won't need to use $this- when calling it from a controller.
You'll probably need to do something like:
$mailer = new Mailer;
$mailer-AddAddress('[EMAIL PROTECTED]');
I suggest brushing up on PHP OOP techniques. The book PHP 5 Objects,
Patterns, and Practice by Zandstra is a great way to
You would have to use a custom model to overwrite some functionality
(cake 1.x):
E.g
class MyHtml extends Html
{
...
function setFormTag($tagValue) {
$parts = explode(/, $tagValue);
$this-model = $parts[0];
$this-field= array_pop($parts);
// We add a class
Hi Bakers,
I am working on a refactoring project for an existing cms andI have
decided to make it using cake.
The CMS has an existing database with
thousands of articles, stored basically as HTML code, where all the
links and images appear as HTML tags like href..., or img...with
relative
Korcs,
Thanks for re-posting on the Group :)
Could you provide some additional code?
From what I can tell, you would need a custom helper like so:
class CustomHelper
{
function parseAnchors($content)
{
// Replaces all anchors locations to an absolute value.
return
I am trying to add a new article to the Bakery, but there are no
categories. The article cannot be submitted without a category, so I'm
stuck.
Can the person/people who maintain the Bakery take a look at this?
-Erich-
--~--~-~--~~~---~--~~
You received this
hi,
i am traing to insert data with a one to one relationship, i am
working with this tables:
CREATE TABLE 'people` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`lastname` varchar(40) NOT NULL,
`firstname` varchar(40) NOT NULL,
PRIMARY KEY (`id`) )
CREATE TABLE `judges` (
I cant generate this kind of format ['model'][0]['Name'], ['model'][1]
['Name]
but I m trying to put the id into tag name
$html-input(product/qty.$product['Product']['id']);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
hi,
i am traing to insert data with a one to one relationship, i am
working with this tables:
CREATE TABLE 'people` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`lastname` varchar(40) NOT NULL,
`firstname` varchar(40) NOT NULL,
PRIMARY KEY (`id`) )
CREATE TABLE `judges` (
I'd like to use this, but I can't figure out how to access MySQL,
because the database is running on a non-standard port. With CakePHP,
I can define the host as hostname:port, but this doesn't work with the
plugin. It's using ADOdb, and I can't seem to define a port using any
of the included
Hello,
I have a strange problem. Developing in Win2k with php5 eveything is
working.
But porting to Linux with php4, I get an error when calling
$javascript-link(...);
in a renderElement('header');
First I thought it could be the readerElement, which has problems, but
putting
the same code into
Please submit bug reports to https://trac.cakephp.org/newticket.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from
My problem is that every time i update my profile, it does an insert
instead of an update sql command. Is my associations incorrect ?
Thanks.
class Member extends AppModel
{
var $name = 'Member';
var $hasOne = array('Profile' =
array('className'
Forbidden
TICKET_CREATE privileges are required to perform this operation
TracGuide The Trac User and Administration Guide
gwoo wrote:
Please submit bug reports to https://trac.cakephp.org/newticket.
--~--~-~--~~~---~--~~
You received this message
This is the problem we discussed gwoo. Should be fixed today.
-MI
---
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
blog:
Another method that was referenced in this group a while back was to
use tags like
['model0']['Name']
['model1']['Name']
Then in your controller, dynamically create a new model for each
'modelX' that you have and validate() it and then save() it.
This way you also get the proper validation
Absolutly steve, get posting so we can get baking :). I haven't had to
do this yet but I know it'll be coming soon.
Tane
On 3/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Another method that was referenced in this group a while back was to
use tags like
['model0']['Name']
hello all,
can anybody help please ?
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group,
I feel like an idiot for asking since there are so many posts in this
group on Ajax-link questions but, I have already wasted 2 hours
trying to find the answer.
I was following a small tutorial to get Ajax working (the one with the
stars =D ) and it didn't work. So, I tried to do a little test
Oh yeah, this is the source in the page after it is rendered:
div id=testola/div
a href=/user/login/ id=link191330890 onclick= return
false;Log In/a
script type=text/javascript
Event.observe('link191330890', 'click', function(event){ new
Ajax.Updater('mainContent','/user/login/',
make sure that your defauly layout includes the prototype/
scriptalicious stuff, and that it is actually loding
On 3/26/07, Christopher E. Franklin, Sr.
[EMAIL PROTECTED] wrote:
Oh yeah, this is the source in the page after it is rendered:
div id=testola/div
a href=/user/login/
@ianh
I followed your instructions, but I am now getting an SQL error during
validation! I don't understand how, why or where the query takes
place, but the error I get shows that a query ('__sanitize') is being
made to the db. I am using Zend's IDE that I purched a few years ago,
but it isn't
Ir Even better just bake it... if you can't bake it then:
(i haven't played with 1.2 yet, but unless it was drastically changed
from 1.1.x, this is how you i do it:)
change:
turn on admin routing, then:
http://www.domain.com/admin/controller/action
class ControllerController extends
can you post some more code in the bin http://bin.cakephp.org maybe
there is a simple typo that some fresh eyes might see.
Sam D
On 3/26/07, Christopher E. Franklin, Sr.
[EMAIL PROTECTED] wrote:
I did. It is loading. When it doesn't I get the error about the
undefined function Event
in your provided code,
we might to update helper.php
var $tags = array('link' = 'a href=%s %s%s/a',
'mailto' = 'a
href=mailto:%s; %s%s/a',
'form' = 'form %s',
Thanks for your help, I'll be looking into elements then.
On Mar 25, 3:06 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
elements :)
On Mar 25, 12:13 pm, nitsuj [EMAIL PROTECTED] wrote:
Hi everyone,
I've just started trying to use cake, I've followed a few tutorials
and readpartsof the
Well, I found a quick tutorial on cakebaker that I have tried and even
that doesn't seem to work.
It is a bare user plugin so I am just uploading it to this group as
test_user_plugin.zip.
The only thing you would need to change is the user_app_model.php
public $useTable = false;
Then you can
Really wierd but, it's working now. When I included scriptaculous
using $javascript-link(scriptaculous);, the script would include
the needed file by itself add a whole url in the src tag (example:
script src=http://localhost/js/builder.js; type=text/javascript).
I commented out the part where
CC96AI,
You're right about modifying the tag templates.
There would have to be more changes than the ones i mentioned above.
However, it's a starting point :).
As for it being a good idea, you can implement your own tags. Since
you're subclassing HtmlHelper you can redefine the $tags class
Hi,
Since my site was attacked by spammers, I was working on a solution,
that generates some random input boxes inside my formula.
when these (hidden by several methods) were filled by an automated
spam-robot, the following action will not take place.
the other inputs had to be randomly renamed.
I opened a ticket for this topic:
https://trac.cakephp.org/ticket/2298#preview
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To
So all you want is for your helper to have the same interface as the
Form/Html helper, but save the requested field names to the session
and generate new random field names which are passed to the real Form/
Html helper?
In that case, your helper can either have var $helpers =
I'd like to know if using requestAction in the view breaks (too
much) the MVC concept, or is it a good use?
I've been doing due to the 'high' load of a website i'm working. An example:
?php echo $this-renderElement('listas/destaque-principal',
array('listas' =
What version of PHP, and what OS? As far as I am concerned, dealing
with timezones on PHP4 and Windows is just too much trouble - the
timezones need to be in a windows specific format (
http://bugs.php.net/bug.php?id=22418
) rather than the common TZ format.
If you have PHP5, just use
To have a variable available in your views and elements try this in
your controller (or AppController):
function beforeRender()
{
$this-set('variable', 'whatever you want');
}
In your views and elements you should be able to access $variable.
On Mar 22, 9:36 pm, dizz [EMAIL PROTECTED] wrote:
Not at all, calling requestAction() from elements/view is perfectly
acceptable. Though you could also call it from the controller and set a var
for the view to get, but again, I see no issue on the way you are doing it
now (as a matter of fact much of The Bakery elements use this approach.)
Is it possible to create a hierarchy of model classes? Cake doesn't
seem too happy when I try.
What I mean is that I have a table, let's say People. I've created
two models which use this table, let's say Man and Woman. The
reason they're different is that they have different validation rules,
Hi,
I wanted to know how getLastInsertID works. I am especially concerned
when two different users are posting two different articles at the
exactly same time (although chances are extremely rare but is
possible), then what getLastInsertID returns..does it works within a
particular session or is
Hi bingo
Nate made the comment a little while ago (in response to my question
along similar lines) that getLastIntertID will do what it is meant to.
I don't remember the details, however a quick search of this group
should turn up the thread.
Given that no-one ever complains that
As I understand, it works on the last query performed by that user, so
you are always going to get the correct ID.
I've never had any trouble with it with a heavily used CRM/CMS system.
On Mar 27, 1:07 pm, bingo [EMAIL PROTECTED] wrote:
Hi,
I wanted to know how getLastInsertID works. I am
One small correction - below, when I said I hoped I could define the
belongsTo relationship at some superclass level and have it
inherited by subclasses, I meant, at least for my hypothetical
example, the hasMany relationship.
thanks.
On Mar 26, 8:06 pm, TekJansen [EMAIL PROTECTED] wrote:
I
Hi Alex,
I think You will want to review what AD7six has done - You can (at
least) grab some idea how this can be done without modification of
core helpers:
http://www.noswad.me.uk/MiBlog/Spam
Jitka
--~--~-~--~~~---~--~~
You received this message because you
Hi. Thanks to everybody who replied. I was able to fix the problem by
using single quotes. Hehe.
On Mar 12, 3:10 pm, Chris Lamb [EMAIL PROTECTED] wrote:
Mariano Iglesias [EMAIL PROTECTED] wrote:
This issue was solved some time ago:
https://trac.cakephp.org/ticket/2060
I looked at the API
On Mar 27, 12:17 am, fr3nch13 [EMAIL PROTECTED] wrote:
Ir Even better just bake it... if you can't bake it then:
(i haven't played with 1.2 yet, but unless it was drastically changed
from 1.1.x, this is how you i do it:)
change:
turn on admin routing,
On 3/25/07, jonathan.snook [EMAIL PROTECTED] wrote:
There's still two main features that I need to add:
1) RSS feeds for the job listing
2) a way for people to contact you through the site
I'll see about getting those in sometime within the week.
Tried it - Nice :)
Tarique
--
Hi,
Thanks for trying the code out - there are no SQL queries within the
__sanitize function and the error as described sounds *really* counter-
intuitive. What version of cake are you using out of interest?
In terms of your controller block, nothing obviously wrong there, you
may wish to
55 matches
Mail list logo