Re: [fw-general] Removing of intersection table fields in findManyToManyRowset()
any one ? On Wed, Feb 24, 2010 at 3:38 PM, Nicolas Grevet wrote: > Hello, > > On the 19th of February, Ralph commited a modification of the Zend_Db_Table > behavior. Seems like they arbitrary decided that > Zend_Db_Table_Row::findManyToManyRowset() would not return the fields of the > intersection table anymore. While I can understand why (name collision), our > system heavily relied on this feature and we're now looking for the new way > to do it. Anyone knows how to return the fields of the intersection table in > the same request? > > Regards, > - Nicolas > > --- standard/trunk/library/Zend/Db/Table/Row/Abstract.php 2010-02-19 > 21:07:00 UTC (rev 21099) > +++ standard/trunk/library/Zend/Db/Table/Row/Abstract.php 2010-02-19 > 21:09:23 UTC (rev 21100) > @@ -1051,7 +1051,7 @@ > > - $select->from(array('i' => $interName), Zend_Db_Select::SQL_WILDCARD, > $interSchema) > + $select->from(array('i' => $interName), array(), $interSchema) > -- Elvin Şiriyev http://siriyev.net
[fw-general] is that bug?
Keywords: Zend_Navigation, Route, Mvc, Zend_Navigation_Page_Mvc. hi, when i use route like that: - resources.router.routes.category.route = "/c/:id/:name" resources.router.routes.category.defaults.controller=index resources.router.routes.category.defaults.action=products resources.router.routes.category.defaults.id=0 resources.router.routes.category.defaults.name=Categori - and navigation like that: - $page = new Zend_Navigation_Page_Mvc(array( 'id' => 'tree_' . $row->id, 'route' => 'category', 'label' => $row->name, * //'controller' => 'index', //'action' => 'products',* 'params' => array( 'id' => $row->id, 'name' => $row->name ) )); - at rendered menu there was not any active link. and breadcrumbs show noting. when i uncomment *//'controller' => 'index', //'action' => 'products', *then every thing was ok. but it should work witouth controller and action info, because i gave route name to Page object. but i thing it is a bug from Zend/Navigation/Page/Mvc.php at *function isActive()*. when i convert (Module, Controller, Action) - $front->getDefault*(); (at line 144, 150 and 156) - to --------- $front->getRequest()->get*Name(); - then there is not any problem also. i'm using 1.10.0beta1 version. PS. sorry for my english. -- Elvin Şiriyev http://siriyev.net
Re: [fw-general] Inserting a text string or paragraph into Zend_Form
or element1; ?> TEXT element2; ?> On Fri, Aug 21, 2009 at 11:40 PM, Eugene Morgan < eugenemorganrea...@gmail.com> wrote: > The quick way is to use the Description decorator as follows ... > $textElement = new Zend_Form_Element('someElement'); > $textElement->setDescription('TEXT'); > > If you are wanting something more complex you could define your own > decorator. > > On Thu, Aug 20, 2009 at 11:49 AM, Enkhbilguun > Erdenetsogt wrote: > > Hello, > > > > I just wonder how to insert a paragraph or a text string into Zend Form > > elements? > > > > I'm expecting: > > > > > > TEXT > > > > > > > > Do you know how to? > > > > > > Thanks ;-) > > > -- Elvin Şiriyev http://siriyev.net
Re: [fw-general] Segmentation fault
And with $ sudo php -v it is working. but running zf as root there is same error. 2009/8/23 Elvin Şiriyev > i think it is fault of php-cli. because of that : > > $ php -v > PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009 > 14:35:05) > Copyright (c) 1997-2008 The PHP Group > Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies > Segmentation fault > > PHP version : 5.2.6-3ubuntu4.1 > ZF version : 1.9.1 > OS : ubuntu jaunty 9.04 > include_path : .:/usr/share/php:/usr/share/pear > > > > On Sun, Aug 23, 2009 at 2:14 AM, Matthew Weier O'Phinney > wrote: > > > > -- Elvin Şiriyev wrote > > (on Sunday, 23 August 2009, 12:49 AM +0500): > > > I don't know why i get that error message. please help. thanks. > > > > > > $ zf show version > > > Segmentation fault > > > > Can you tell us: > > * what version of ZF you are using > > * what version of PHP you are using > > * what OS you are using (and optimally, what shell -- bash, zsh, etc) > > * what your include_path looks like > > > > Those items will better aid in diagnosis of the issue. > > > > -- > > Matthew Weier O'Phinney > > Project Lead| matt...@zend.com > > Zend Framework | http://framework.zend.com/ > > <http://siriyev.net> >
Re: [fw-general] Segmentation fault
i think it is fault of php-cli. because of that : $ php -v PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009 14:35:05) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies Segmentation fault PHP version : 5.2.6-3ubuntu4.1 ZF version : 1.9.1 OS : ubuntu jaunty 9.04 include_path : .:/usr/share/php:/usr/share/pear On Sun, Aug 23, 2009 at 2:14 AM, Matthew Weier O'Phinney wrote: > > -- Elvin Şiriyev wrote > (on Sunday, 23 August 2009, 12:49 AM +0500): > > I don't know why i get that error message. please help. thanks. > > > > $ zf show version > > Segmentation fault > > Can you tell us: > * what version of ZF you are using > * what version of PHP you are using > * what OS you are using (and optimally, what shell -- bash, zsh, etc) > * what your include_path looks like > > Those items will better aid in diagnosis of the issue. > > -- > Matthew Weier O'Phinney > Project Lead| matt...@zend.com > Zend Framework | http://framework.zend.com/ -- Elvin Şiriyev http://siriyev.net
[fw-general] Segmentation fault
I don't know why i get that error message. please help. thanks. $ zf show version Segmentation fault
[fw-general] find + sed strip require_once
i think command[1] must change for Zend_Application. ? [1] http://framework.zend.com/manual/en/performance.classloading.html#performance.classloading.striprequires.sed -- Elvin Şiriyev http://siriyev.net
Re: [fw-general] How to get row ID back when using Save
try $row->id On Fri, May 29, 2009 at 7:24 PM, Jalil F. wrote: > > > I am very new to Zend. I have a Books model object that extends > Zend_Db_Table. In my controller, I create a new row like this: > >$t = new Books(); >$row = $t->createRow(); >$row->name = $form->getValue('name'); >$row->save(); > > > My table has an ID column that is the primary key and is automatically > incremented. How can I get back the ID of the row I just created and saved? > > > Thanks, > > -J > -- > View this message in context: > http://www.nabble.com/How-to-get-row-ID-back-when-using-Save-tp23782987p23782987.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- Elvin Şiriyev http://siriyev.net
Re: [fw-general] applicationi.ini and connect to db
with reading quickstart and some manual On Wed, May 27, 2009 at 2:37 PM, robyd wrote: > > > Yes, but how can I do in my case? > > > > Jurian Sluiman wrote: > > > > Op Wednesday 27 May 2009 13:08:16 schreef robyd: > >> Hi, > >> i start to study zend framework and i read any tutorials. > >> > >> I'don't understand how do a query in mysql db. > >> > >> i configure the application.ini with the params db: > >> > >> resources.db.adapter = PDO_MYSQL > >> resources.db.params.host = localhost > >> resources.db.params.username = root > >> resources.db.params.password = root > >> resources.db.params.dbname = news > >> > >> > >> My db: > >> > >> table news > >> > >> id title description date author > >> > >> > >> I would to do: > >> > >> in the home page i show the news list. > >> > >> In the model folder i create a News.php file with the function: > >> > >> public function getAllNews() > >> { > >> > >> $sql = 'SELECT * FROM news ORDER BY data DESC'; > >> } > >> > >> but can i connect to my db for the query? > >> > >> > >> thanks. > > > > Hi, > > A good start point is the quickstart of the Zend Framework: > > http://framework.zend.com/docs/quickstart/ > > > > Regards, Jurian > > -- > > Jurian Sluiman > > Soflomo.com > > > > > > -- > View this message in context: > http://www.nabble.com/applicationi.ini-and-connect-to-db-tp23740320p23740753.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- Elvin Şiriyev http://siriyev.net
Re: [fw-general] How to get an application resource inside a controller action
i can access to db from Zend_Db_Table::getDefaultAdapter(), but for locale, configurations, acl and etc. there must be fast access from controller and view. am i think right? On Wed, May 27, 2009 at 10:10 AM, Dalibor Karlović wrote: > On Tuesday 26 May 2009 20:40:38 Vladas Diržys wrote: > > Hi, > > > > what is the right way to get a db (or any other) resource in the > > controller? Now I'm using following line: > > $this->getFrontController()->getParam('bootstrap')->getResource('db'); > > Why do you need you DB instance inside your controller? > > -- > Dado > -- Elvin Şiriyev http://siriyev.net
[fw-general] Re: Bootstrap + Translate + Route
isn't any advice about that? 2009/5/14 Elvin Şiriyev > Hi, > with following router i can take url's like that: > example.com/en/index/index > > at Bootstrap* > protected function _initTranslate() {}* > i can't take "*en*" with* > Zend_Controller_Front::getInstance()->getRequest()->getParam('lang')* > to spesify Zend_Locale; > > // my route > $route = new Zend_Controller_Router_Route(':lang/:controller/:action/*', > array('lang' => > Zend_Registry::get('Zend_Translate')->getLocale(), > 'controller' => 'index', > 'action' => 'index')); > > can anybody help about that? > and > can i write that route in application.ini ? > > > thanks. > > -- > Elvin Şiriyev > http://elvin.siriyev.net > -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] how to access bootstrap resource (DB) from Zend_Form class?
i think it is: Zend_Db_Table::getDefaultAdapter() On Thu, May 14, 2009 at 7:53 AM, iceangel89 wrote: > > i need to get my DB from my Zend_Form class anyway to do that? and in > general, how is the best way to get my db? like in validators or filters? > -- > View this message in context: > http://www.nabble.com/how-to-access-bootstrap-resource-%28DB%29-from-Zend_Form-class--tp23534307p23534307.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Bootstrap + Translate + Route
Hi, with following router i can take url's like that: example.com/en/index/index at Bootstrap* protected function _initTranslate() {}* i can't take "*en*" with* Zend_Controller_Front::getInstance()->getRequest()->getParam('lang')* to spesify Zend_Locale; // my route $route = new Zend_Controller_Router_Route(':lang/:controller/:action/*', array('lang' => Zend_Registry::get('Zend_Translate')->getLocale(), 'controller' => 'index', 'action' => 'index')); can anybody help about that? and can i write that route in application.ini ? thanks. -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] how handle Locale ?
I think i'm looking for function like that: http://tr.php.net/manual/en/locale.lookup.php is there any thing like that? On Fri, May 8, 2009 at 6:40 PM, Thomas Weidner wrote: > Again, please look into the manual. > There you can read that locales are ONLY downwards detectable. > > Example: > When your user requests en_US then en can be used instead > > BUT > When your user requests en and you give en_US and en_GB and en_VE, how > should the system then know which locale should be used ? > > There is no way, so you can only set the wished locale manually in this > case. > All the reasons, and solutions are described in the manual. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > - Original Message - From: "Elvin Şiriyev" > To: "Thomas Weidner" > Cc: > Sent: Friday, May 08, 2009 3:12 PM > Subject: Re: [fw-general] how handle Locale ? > > > > I can disable notice but zend locale can't choose nearest (tr_TR) instead > of > 'tr' :) is there any easy way for that? > resources.translate.locale is not what i want. > > thanks > > On Fri, May 8, 2009 at 4:06 PM, Thomas Weidner >wrote: > > You said that you "must" be able to select "tr_TR" but your user don't >> select it. >> Your user selects "tr" but this language is not available, so a notice is >> thrown. >> >> Note that a NOTICE is not a error and you can also disable it. Look into >> the manual. >> >> Greetings >> Thomas Weidner, I18N Team Leader, Zend Framework >> http://www.thomasweidner.com >> >> - Original Message - From: "Elvin Şiriyev" >> To: >> Sent: Friday, May 08, 2009 1:35 PM >> Subject: [fw-general] how handle Locale ? >> >> >> >> hi, >> my language files and Zend_Application Bootstrap resources config at blow. >> With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some >> error. >> >> >> How can i handle that? (it must select Locale as tr_TR and interface.tr_TR >> with that accepted languages) >> >> thanks. >> >> *Errors* >> - >> Notice: The language 'tr' has to be added before it can be used. in >> /usr/share/php/Zend/Translate/Adapter.php on line 317 >> Notice: No translation for the language 'tr' available. in >> /usr/share/php/Zend/Translate/Adapter.php on line 330 >> >> *languages Folder* >> -------- >> languages/interface.en_US >> languages/interface.ar_AE >> languages/interface.ru_RU >> languages/interface.zh_CN >> languages/interface.tr_TR >> >> *application.ini* >> --- >> resources.translate.adapter = ini >> resources.translate.data = APPLICATION_PATH "/../languages" >> resources.translate.options.scan = filename >> >> -- >> Elvin Şiriyev >> http://elvin.siriyev.net >> >> >> > > -- > Elvin Şiriyev > http://elvin.siriyev.net > > -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] how handle Locale ?
I can disable notice but zend locale can't choose nearest (tr_TR) instead of 'tr' :) is there any easy way for that? resources.translate.locale is not what i want. thanks On Fri, May 8, 2009 at 4:06 PM, Thomas Weidner wrote: > You said that you "must" be able to select "tr_TR" but your user don't > select it. > Your user selects "tr" but this language is not available, so a notice is > thrown. > > Note that a NOTICE is not a error and you can also disable it. Look into > the manual. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > - Original Message - From: "Elvin Şiriyev" > To: > Sent: Friday, May 08, 2009 1:35 PM > Subject: [fw-general] how handle Locale ? > > > > hi, > my language files and Zend_Application Bootstrap resources config at blow. > With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some > error. > > > How can i handle that? (it must select Locale as tr_TR and interface.tr_TR > with that accepted languages) > > thanks. > > *Errors* > - > Notice: The language 'tr' has to be added before it can be used. in > /usr/share/php/Zend/Translate/Adapter.php on line 317 > Notice: No translation for the language 'tr' available. in > /usr/share/php/Zend/Translate/Adapter.php on line 330 > > *languages Folder* > > languages/interface.en_US > languages/interface.ar_AE > languages/interface.ru_RU > languages/interface.zh_CN > languages/interface.tr_TR > > *application.ini* > ------- > resources.translate.adapter = ini > resources.translate.data = APPLICATION_PATH "/../languages" > resources.translate.options.scan = filename > > -- > Elvin Şiriyev > http://elvin.siriyev.net > > -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] how handle Locale ?
hi, my language files and Zend_Application Bootstrap resources config at blow. With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some error. How can i handle that? (it must select Locale as tr_TR and interface.tr_TR with that accepted languages) thanks. *Errors* - Notice: The language 'tr' has to be added before it can be used. in /usr/share/php/Zend/Translate/Adapter.php on line 317 Notice: No translation for the language 'tr' available. in /usr/share/php/Zend/Translate/Adapter.php on line 330 *languages Folder* languages/interface.en_US languages/interface.ar_AE languages/interface.ru_RU languages/interface.zh_CN languages/interface.tr_TR *application.ini* --- resources.translate.adapter = ini resources.translate.data = APPLICATION_PATH "/../languages" resources.translate.options.scan = filename -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] Get Resources (DB) from Controllers
Hi, is that best way to access resources like db, config, navigation, router, translate from controller like that? $this->getInvokeArg('bootstrap')->getResource('myResource'); Thanks. On Thu, May 7, 2009 at 6:28 PM, Sergio Rinaudo wrote: > Or also like this > > $bootstrap = $this->getInvokeArg('bootstrap'); > $resource = $bootstrap->getResource('myResource'); > > Sergio Rinaudo > > -- > Date: Thu, 7 May 2009 17:23:42 +0200 > From: pbouli...@alteo.fr > To: fw-general@lists.zend.com > Subject: Re: [fw-general] Get Resources (DB) from Controllers > > > Sorry, i make a mistake, i forget the "t" in "bootstrap" : > > $this->getFrontController()->getParam('boo*t*strap')->getResource('HereTheResourceYouNeed') > > > > Pierrick Boulière a écrit : > > In your controller (or controller action), you can get the resource you > need by : > > $this->getFrontController()->getParam('boostrap')->getResource('HereTheResourceYouNeed') > > > example : > $this->getFrontController()->getParam('boostrap')->getResource('db') > > iceangel89 a écrit : > > how can i access resources like the default db adapter from my controllers? > > > > > -- > Chiamate gratis da PC a PC? Provale da > Messenger!<http://messenger.it/videoconversazioni.aspx> > -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] Confused with classes, helpers and html tables
http://framework.zend.com/wiki/display/ZFPROP/Zend_DataGrid ? On Mon, May 4, 2009 at 8:15 PM, elminster wrote: > Hi. I wanted to use a class to generate an html table object before finally > outputting this object in the view. I used to do this in non ZF OO PHP by > creating my table object, and gradually adding rows and columns etc. I > already have this code, and their doesnt seem to be a feature in ZF for > doing this, so I was going to reuse this code. But I'm not sure where to put > it. It is not a model. So it must be a helper. But you dont seem to be a ble > to create a helper object, only call its methods. Am I just putting it in > the wrong place or do I need to rewrite the code so that I can use it as a > helper. Or I just cant do this in the framework? Thanks for any help. > -- > View this message in context: Confused with classes, helpers and html > tables<http://www.nabble.com/Confused-with-classes%2C-helpers-and-html-tables-tp23372632p23372632.html> > Sent from the Zend Framework mailing list > archive<http://www.nabble.com/Zend-Framework-f15440.html>at Nabble.com. > -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] Forms in Table
i use following css for table-look dl {display:block;} dt {clear:left;display:block;font-weight:bold;float:left;width:155px;border-top:1px solid #666;color:#F48120;} dd {clear:right;display:block;margin-left:155px;padding:3px;border-top:1px solid #666;background-color:#56585d;} On Mon, May 4, 2009 at 7:28 AM, iceangel89 wrote: > > i want to decorate my form in a table something like > http://www.nabble.com/How-render-Zend_Form-to-html-table--td15299082.html > > except in the following format > > ++--+---+ > | label |label | label | > ++--+---+ > |element| element | element | > ++--+---+ > > and maybe in abit more conplex like > > + + + - + > | | static header | static header | > + + + - + > | static header | elem | elem | > + + + - + > | static header | elem | elem | > + + + - + > > can i do it? > -- > View this message in context: > http://www.nabble.com/Forms-in-Table-tp23362936p23362936.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Zend_Form_Element_Multi::setDisableTranslator(true) -- Bug ?
Hi, Is that bug ? (when translater disabled on select options aren't not render. ) // PHP $element = new Zend_Form_Element_Select('name'); //$element->setDisableTranslator(true); $element->addMultiOptions(array('A', 'B', 'C')); $this->view->element = $element; // HTML A B C // PHP $element = new Zend_Form_Element_Select('name'); $element->setDisableTranslator(true); $element->addMultiOptions(array('A', 'B', 'C')); $this->view->element = $element; // HTML -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Zend_Application + Zend_Translate + Zend_Log
Hi, how can i confugure log for Zend_Translate in application.ini with Zend_Application ? resources.translate.adapter = ini resources.translate.data = APPLICATION_PATH "/../languages" resources.translate.default = en_US resources.translate.options.scan = directory resources.translate.options.log = ? Thanks On Wed, Apr 29, 2009 at 6:41 PM, Brad Kowalczyk wrote: > Thanks Matthew, I figured this must have been the case - just that after > seeing it in the docs I thought perhaps it was supposed to be working in the > current stable release and was perhaps broken or unintentionally left out, > so I just made an attempt to fill in the gaps. > > Do you think it would be a good idea to label libs in the documentation > with the minimum ZF version required? Just a thought. > > Brad > > On Wed 29/04/09 10:09 PM , Matthew Weier O'Phinney > wrote: > > -- Brad Kowalczyk wrote > (on Wednesday, 29 April 2009, 03:08 AM +0200): > > I just setup the zf.sh and zf.php scripts in my env then svn exported the > Zend/ > > CodeGenerator lib into the appropriate location (it was not incl in the > full ZF > > download) and tried to create a new project using the 'zf create project > ...' > > command. I got this: > > > > Fatal error: Call to undefined method > > Zend_CodeGenerator_Php_File::fromreflectedfilepath() in /usr/local/lib/ > > ZendFramework-1.7.8/incubator/library/Zend/Tool/Project/Context/Zf/ > > ActionMethod.php on line 82 > > > > Has this method been removed from the current svn version? (as mentioned > above > > everything under Zend/CodeGenerator was exported from svn the rest is > regular > > 1.7.8) Is there any way I can get this to work or do I need to use the > entire > > svn version or is there somewhere else I can get a working > Zend/CodeGenerator > > lib? > > You should use it directly from svn trunk, or the 1.8 release branch, or > wait until the 1.8 release (tomorrow). In each of those cases, yes, it's > working correctly .It does not work correctly from 1.7.8, and mixing it > into an existing release is not something I would expect to work (there > are many dependencies, some of which are on features specific to the 1.8 > release.) > > -- > Matthew Weier O'Phinney > Project Lead | matt...@zend.com > Zend Framework | http://framework.zend.com/";>http://framework.zend.com/ > > -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] ZF (Zend_Tool)
ok, thanks all 2009/4/24 Mon Zafra > I modified zf.php and added a simple autoloader > > function __autoload($class) > { > include str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; > } > > It got rid of the error below. > > There's a problem though if you're using Zend Server like me. It seems that > its PHP binary is compiled without tokenizer support, so the token_get_all() > call in Zend_Reflection_File fails. > >-- Mon > > > 2009/4/24 Rob Allen > > >> On 24 Apr 2009, at 09:33, Elvin Şiriyev wrote: >> >> Hi, >>> is there any useful documentation about zf command? >>> >>> $ alias zf=/home/../ZendFramework-1.8.0b1/bin/zf.sh >>> $ zf show version >>> Zend Framework Version: 1.8.0beta >>> $ export ZF_PATH=/home/../ZendFramework-1.8.0b1/library/ >>> $ zf create project zfnew >>> >>> Fatal error: Class 'Zend_Controller_Action' not found in >>> /home/../zfnew/application/controllers/IndexController.php on line 3 >>> >>> >> Hi Elvin, >> >> Ralph is working on it ;) >> >> Regards, >> >> Rob... >> >> >> >> > -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] ZF (Zend_Tool)
Hi, is there any useful documentation about zf command? $ alias zf=/home/../ZendFramework-1.8.0b1/bin/zf.sh $ zf show version Zend Framework Version: 1.8.0beta $ export ZF_PATH=/home/../ZendFramework-1.8.0b1/library/ $ zf create project zfnew Fatal error: Class 'Zend_Controller_Action' not found in /home/../zfnew/application/controllers/IndexController.php on line 3 -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Zend_Acl for MVC ?
is there any example code about Zend_Acl for MVC (defining and controlling). i mean "ACL for MVC" is : example: guest can't see /default[module]/user[controller]/*[action] but only administrator can access /manage/*/* thx -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] Zend_Application + Controller > Action
i know view helpers. but i think this is expensive and there must be an other (pre defined) ways. whatever. thank a lot 2009/4/8 Thomas VEQUAUD > You'd better use Zend_View_Helper : > > *Just a little example* > 1. In /application/views/script/helpers/ControllerName.php > class Zend_View_Helper_ControllerName > { > function controllerName() > { > // Controller name > $fc = Zend_Controller_Front::getInstance(); > $request = $fc->getRequest(); > $controllerName = strtolower($request->getControllerName()); > return ($controllerName); > } > } > > 2. Then, you can call this method wherever you want > in a controller : $this->view->controllerName() > in a view script : $this->controllerName() > > > > 2009/4/8 Elvin Şiriyev > >> another question for layout. >> for >> http://www.w3.org/1999/xhtml"; >> xml:lang="translate->getLocale()?>" >> lang="translate->getLocale()?>"> >> >> i solved it like >> abstract App_Controller_Action extends Zend_Controller_Action { >> function init(){ >>parent::init(); >>$this->translate = Zend_Registry::get(''); >>$this->view->translate = $this->translate; >>... >>.. >>. (user, acl, navigation etc.) >> } >> } >> but i didn't like that way. >> >> and i need $user object (ex. Zend_DbTable_Row), or Zend_Acl at lot of view >> scripts >> >> PS. sorry for my english. >> >> >> 2009/4/8 keith Pope >> >>> Accessing from controller is done via $this->getInvokeArg(), if you >>> use FC parameter. >>> >>> You may want to look at why you want to have config, cache and locale >>> access in your view, generally this would happen in the Model or >>> controller. >>> >>> If you do need to do this I would suggest using a view helper, this >>> way you encapsulate the access away from the main view scripts. >>> >>> class Zend_View_Helper_MyViewHelper >>> { >>>public function MyViewHelper () >>>{ >>>$fc = Zend_Controller_Front::getInstance(); >>> $fc->getParam('xxx'); >>> >>>// or >>> $config = Zend_Registry::get('Zend_Config') >>>} >>> } >>> >>> There are of course many ways to do push stuff into views, in your >>> bootstrap you can set variables on the view, and you can use front >>> controller plugin, action helpers etc. >>> >>> Just have a think to why you need to do this, it may be that this >>> should be handled in your Model. >>> >>> Thx >>> >>> Keith >>> >>> 2009/4/8 Elvin Şiriyev : >>> > 2. way sounds good. but how can i access frontController's params from >>> > controller and view script ? >>> > i dont like write that codes for each Action >>> > -- >>> > $config = Zend_Registry::get('Zend_Config'); >>> > $cache = Zend_Registry::get('Zend_Cache'); >>> > $locale = Zend_Registry::get('Zend_Locale'); >>> > .. >>> > . >>> > $this->view->config = $config; >>> > $this->view->cache = $cache; >>> > $this->view->locale = $locale; >>> > .. >>> > . >>> > - >>> > 2009/4/8 keith Pope >>> >> >>> >> Maybe use the registry for that, so have a bootstrap class resource >>> >> that fetches the plugin resources: >>> >> >>> >> protected _initRegistry() >>> >> { >>> >>$this->bootstrap('db'); >>> >>Zend_Registry::set('dbResource', $this->getPluginResource('db')); >>> >> } >>> >> >>> >> Or you could pass them as params to the front controller, which would >>> >> make them accessible inside controllers: >>> >> >>> >> protected _initFrontControllerExtras() >>> >> { >>> >>$this->bootstrap('frontcontroller'); >>> >>$this->frontController->setParam('x','xxx
Re: [fw-general] Zend_Application + Controller > Action
another question for layout. for http://www.w3.org/1999/xhtml"; xml:lang="translate->getLocale()?>" lang="translate->getLocale()?>"> i solved it like abstract App_Controller_Action extends Zend_Controller_Action { function init(){ parent::init(); $this->translate = Zend_Registry::get(''); $this->view->translate = $this->translate; ... .. . (user, acl, navigation etc.) } } but i didn't like that way. and i need $user object (ex. Zend_DbTable_Row), or Zend_Acl at lot of view scripts PS. sorry for my english. 2009/4/8 keith Pope > Accessing from controller is done via $this->getInvokeArg(), if you > use FC parameter. > > You may want to look at why you want to have config, cache and locale > access in your view, generally this would happen in the Model or > controller. > > If you do need to do this I would suggest using a view helper, this > way you encapsulate the access away from the main view scripts. > > class Zend_View_Helper_MyViewHelper > { >public function MyViewHelper () >{ >$fc = Zend_Controller_Front::getInstance(); >$fc->getParam('xxx'); > >// or > $config = Zend_Registry::get('Zend_Config') >} > } > > There are of course many ways to do push stuff into views, in your > bootstrap you can set variables on the view, and you can use front > controller plugin, action helpers etc. > > Just have a think to why you need to do this, it may be that this > should be handled in your Model. > > Thx > > Keith > > 2009/4/8 Elvin Şiriyev : > > 2. way sounds good. but how can i access frontController's params from > > controller and view script ? > > i dont like write that codes for each Action > > -- > > $config = Zend_Registry::get('Zend_Config'); > > $cache = Zend_Registry::get('Zend_Cache'); > > $locale = Zend_Registry::get('Zend_Locale'); > > .. > > . > > $this->view->config = $config; > > $this->view->cache = $cache; > > $this->view->locale = $locale; > > .. > > . > > - > > 2009/4/8 keith Pope > >> > >> Maybe use the registry for that, so have a bootstrap class resource > >> that fetches the plugin resources: > >> > >> protected _initRegistry() > >> { > >>$this->bootstrap('db'); > >>Zend_Registry::set('dbResource', $this->getPluginResource('db')); > >> } > >> > >> Or you could pass them as params to the front controller, which would > >> make them accessible inside controllers: > >> > >> protected _initFrontControllerExtras() > >> { > >>$this->bootstrap('frontcontroller'); > >>$this->frontController->setParam('x','xxx'); > >>// or > >> > >> > > $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx'); > >> } > >> > >> Hope this helps > >> > >> Keith > >> > >> 2009/4/8 Elvin Şiriyev : > >> > hi, i used Zend_Application with Zend_Application_Resource_*. > >> > how can i access to that objects from my Controller and view? > >> > > >> > for example is there any way to access Zend_Application_Resource_ > >> > Navigation 's getContainer() method from controller like > >> > $this->navigation->getContainer() or $this->db, $this->layout, > >> > $this->locale > >> > or another easy way ? > >> > > >> > thanks > >> > > >> > -- > >> > Elvin Şiriyev > >> > http://elvin.siriyev.net > >> > > >> > -- > >> > Elvin Şiriyev > >> > http://elvin.siriyev.net > >> > > >> > >> > >> > >> -- > >> -- > >> [MuTe] > >> -- > > > > > > > > -- > > Elvin Şiriyev > > http://elvin.siriyev.net > > > > > > -- > -- > [MuTe] > -- > -- Elvin Şiriyev http://elvin.siriyev.net
Re: [fw-general] Zend_Application + Controller > Action
2. way sounds good. but how can i access frontController's params from controller and view script ? i dont like write that codes for each Action -- $config = Zend_Registry::get('Zend_Config'); $cache = Zend_Registry::get('Zend_Cache'); $locale = Zend_Registry::get('Zend_Locale'); .. . $this->view->config = $config; $this->view->cache = $cache; $this->view->locale = $locale; .. . - 2009/4/8 keith Pope > Maybe use the registry for that, so have a bootstrap class resource > that fetches the plugin resources: > > protected _initRegistry() > { >$this->bootstrap('db'); >Zend_Registry::set('dbResource', $this->getPluginResource('db')); > } > > Or you could pass them as params to the front controller, which would > make them accessible inside controllers: > > protected _initFrontControllerExtras() > { >$this->bootstrap('frontcontroller'); >$this->frontController->setParam('x','xxx'); >// or > > > $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx'); > } > > Hope this helps > > Keith > > 2009/4/8 Elvin Şiriyev : > > hi, i used Zend_Application with Zend_Application_Resource_*. > > how can i access to that objects from my Controller and view? > > > > for example is there any way to access Zend_Application_Resource_ > > Navigation 's getContainer() method from controller like > > $this->navigation->getContainer() or $this->db, $this->layout, > $this->locale > > or another easy way ? > > > > thanks > > > > -- > > Elvin Şiriyev > > http://elvin.siriyev.net > > > > -- > > Elvin Şiriyev > > http://elvin.siriyev.net > > > > > > -- > -- > [MuTe] > -- > -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Zend_Application + Controller > Action
hi, i used Zend_Application with Zend_Application_Resource_*. how can i access to that objects from my Controller and view? for example is there any way to access Zend_Application_Resource_ Navigation 's getContainer() method from controller like $this->navigation->getContainer() or $this->db, $this->layout, $this->locale or another easy way ? thanks -- Elvin Şiriyev http://elvin.siriyev.net -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Zend_Application
Where i can download Zend_Application ? i cannot found it in svn. thx -- Elvin Şiriyev http://elvin.siriyev.net
[fw-general] Zend View Limitations
Hi, i want users to change their profiles view (.phtml) script. but i don't want user can write $_SESSION['user_id'] = 1; how can i limit like that functions on view script ?
Re: [fw-general] Zend_Db_Select Order By
hi, but $select->where('b.status = ?', 'new')->order('b.status ASC'); and $select->order("b.status = 'new'"); has 2 differnt results. $select->order("b.status = 'new'"); sort by status where is equal to 'new' at first. On Wed, Oct 8, 2008 at 3:33 PM, Tom Graham <[EMAIL PROTECTED]> wrote: > Hi, > > Try something like: $select->where('b.status = ?', 'new')->order('b.status > ASC'); > > On 8 Oct 2008, at 13:22, Elvin Şiriyev wrote: > > hi, > > i can't use "order by" like that: > > $select->order("b.status = 'new'"); > > Error Message : *Fatal error*: Uncaught exception > 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli prepare error: > Unknown column 'b.status = 'new'' in 'order clause'' in ... > > Thanks for helps, > > -- > Elvin Şiriyev > > > -- Elvin Şiriyev
[fw-general] Zend_Db_Select Order By
hi, i can't use "order by" like that: $select->order("b.status = 'new'"); Error Message : *Fatal error*: Uncaught exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli prepare error: Unknown column 'b.status = 'new'' in 'order clause'' in ... Thanks for helps, -- Elvin Şiriyev