2008年9月2日星期二
Re: [fw-db] Re: Re[fw-db] lated tables reference error
Re: [fw-mvc] Custom Form Decorator
Benjamin
Benjamin.Gonzales wrote:
>
> My Decorator
>
> class My_Form_Decorator_separator extends Zend_Form_Decorator_Abstract
> {
>
> protected $_title='';
>
> public function setTitle($title='')
> {
> $this->_title = $title;
> return $this->_title
> }
>
> public function render ($content)
> {
>
> $html = $this->_title.'<br/><hr/>';
>
> $placement = $this->getPlacement();
> $separator = $this->getSeparator();
> switch ($placement) {
> case self::PREPEND:
> return $html . $separator . $content;
> case self::APPEND:
> default:
> return $content . $separator . $html;
> }
> }
> }
>
> $element = new Zend_Form_Element_Text('test');
> $element->addDecorator(new My_Form_Decorator_separator());
>
>
> I send you as the parameter to the method setTitle?
>
>
> if I do it this way does not work
> $element->addDecorator(new My_Form_Decorator_separator(),
> array('title','test'));
>
>
> I send you as the parameter to the method setTitle?
>
>
--
View this message in context: http://www.nabble.com/Custom-Form-Decorator-tp19256766p19274936.html
Sent from the Zend MVC mailing list archive at Nabble.com.
[fw-db] Re: Re[fw-db] lated tables reference error
>
> Hello all,
> I'm trying to setup a many-to-many relationship between "articles" and
> "keywords", but I keep getting the following error:
>
> Fatal error: Uncaught exception 'Zend_Db_Table_Exception' with message
> 'No reference from table ArticlesKeywords to table Keywords' in......
>
I just tried running your code and it works for me. Did you post exactly
the code you're running? Also, what version of PHP and Zend Framework are
you using? You should specify these things in any problem report.
Check for typos in your code. Also keep in mind that the comparison from
the value 'refTableClass'=>'Keywords' to the class name of Keywords is a
case-sensitive comparison. In other words, if the class name is 'Keywords',
then 'refTableClass'=>'keywords' will cause the error you report.
Here are a couple of other comments I'd like to make, but they're not
directly related to your original question:
$_dependentTables is used only for simulating cascading update and delete.
Since your ArticlesKeywords reference map doesn't mention any cascading
options, you don't need to define $_dependentTables in the two parent tables
at all. And even if you need cascading referential integrity, it's better
to do declare it in the database, as part of your foreign keys.
Your table articles_keywords doesn't need an id column. You should declare
the primary key over (article_id, keyword_id). Otherwise you have no way to
prevent associating a given article to a given keyword more than once.
Regards,
Bill Karwin
--
View this message in context: http://www.nabble.com/Related-tables-reference-error-tp19270293p19274289.html
Sent from the Zend DB mailing list archive at Nabble.com.
[fw-db] Related tables reference error
Re: [fw-db] Zend_Db_Table_Select - Can't join another table ?
You can get the Zend_Db_Select object like this:
$select = $this->getAdapter()->select();
Renan Gonçalves wrote:
>
> Hello all,
>
> I'm trying to increase performance on my application.
> I have a table that always get a parent row.
> So, I want to make a inner join in this tables.
>
> Why I can't do this in Zend_Db_Table_Select ?
>
> I can't use Zend_Db_Select because a have rowClass for each table.
> How I can do this?
>
>
> Best regards,
>
> --
> Renan Gonçalves - Web Developer
> Cell Phone: +55 (11) 8633-6018
> MSN: renan.saddam@gmail.com
> Web Site: renangoncalves.com
> São Paulo - SP/Brazil
>
>
--
View this message in context: http://www.nabble.com/Zend_Db_Table_Select---Can%27t-join-another-table---tp14809625p19268103.html
Sent from the Zend DB mailing list archive at Nabble.com.
Re: [fw-mvc] Zend http_post_fields()
$this->getRequest()->setParams(array($key => $value)) to set your data.
After that use the $this->_forward($action, $controller) method to pass the
request to another action and then retrieve your data using
$this->getRequest()->getUserParam($key);
This will work unless you need a real redirect. In that case you should
store your data in a session.
Hope it helps ;)
Giuliano
SeanZend wrote:
>
> Hi i'm new to the Zend framework, and I wanted to know if Zend has a
> feature such as http_post_fields()? Or something that serves the same
> purpose.
>
> I am trying to post data from one controller to another without submitting
> a form. Does anyone have an example code of how to accomplish this? That
> is if Zend supports this feature?
>
> Thanks
>
>
--
View this message in context: http://www.nabble.com/Zend-http_post_fields%28%29-tp19258609p19265238.html
Sent from the Zend MVC mailing list archive at Nabble.com.
2008年9月1日星期一
[fw-mvc] Zend_Form_Element_Hash implementation problems
Integrating Zend_Form_Elements_Hash should be easy enough - I've done it
on a test site running on my localhost and it works great. However,
when implementing it on a production server that uses a subdomain I
constantly get given the message "No token was provided to match against".
I'm implementing the Hash element in my form like this:
new Zend_Form_Element_Hash('xcsrf', array(
'salt' => __CLASS__ . '_XCSRF'
))
I thought it might be to do with the cookie domain path, as I'm on a
sub-domain which we'll call 'splash.example.co.uk', so in my boostrap I
call this method:
public function initSession()
{
$session = $this->config->session->toArray();
Zend_Session::setOptions($session);
Zend_Session::start();
return $this;
}
with my config session node looking like:
<session>
<name>SPLASH</name>
<cookie_domain>.example.co.uk</cookie_domain>
</session>
But no such luck!
What (probably really obvious) thing am I missing here? Any advice
would be really appreciated!
Thanks,
Andy