Search Results

Search found 4341 results on 174 pages for 'zend navigation'.

Page 69/174 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • Invalid parameter number: number of bound variables does not match number of tokens

    - by Alex
    I have a table: 'objects' with few columns: object_id:int, object_type:int, object_status:int, object_lati:float, object_long:float My query is : $stmt = $db->query('SELECT o.object_id, o.object_type, o.object_status, o.object_lati, o.object_long FROM objects o WHERE o.object_id = 1'); $res = $stmt->fetch(); Pdo throw error: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens When i remove column object_lati or object_long query is work fine.

    Read the article

  • Ignore SSL errors in Zend_Http_Client

    - by webdestroya
    In PHP curl there are two functions used to ignore all SSL errors (invalid cert, self signed, expired, so on): curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); I am switching over to use Zend_Http_Client, but I can't seem to find a way to force it to ignore errors. (I don't have a way to test it just yet, I wanted to see if anybody has done this before) So, does anybody know the equivalent function/functions to do this in Zend_Http_Client?

    Read the article

  • Magento Set Grid to Filter Automatically by Current Day using Existing Datetime Column in Grid

    - by Tegan Snyder
    In Magento I'm creating a custom module and would love to be able to filter automatically by the datetime column so that the intial grid listing shows only entities related to "todays" date. Here is my datetime column: $this->addColumn('ts', array( 'header' => $hlp->__('Activated'), 'align' => 'left', 'index' => 'ts', 'type' => 'datetime', 'width' => '160px', )); I'm think there should be a way for me to just add a filter to the collection like so: $now = Mage::getModel('core/date')->timestamp(time()); $dateTime = date('m/d/y h:i:s', $now); $collection = Mage::getModel('mymodule/items')->getCollection() ->addFieldToFilter('ts', $dateTime); But this doesn't work? Am I using the wrong filter? My "ts" field in the database is a "datetime" field, but the default magento "From: " - "To:" date range selectors don't use hours, minutes, seconds. Any ideas? Thanks, Tegan

    Read the article

  • Sales by Category in Magento?

    - by Tegan Snyder
    We have a category called "Clearance" on our Magento website. Ideally it would be nice to be able to get a report of all orders sold in that category. Is there anyway I can join the orders collection with the products collection and filter by category id? Here is a similar thread: http://www.magentocommerce.com/boards/viewthread/44296/ Any ideas, or am I crazy? It doesn't need to be pretty.

    Read the article

  • What is the purpose of return'ing $this when setting vars in the model

    - by TaMeR
    I am a self thought hobby programmer and therefore don't have the fundamentals always down the way you professionals do. So please excuse me if this is basic. What is the purpose or benefit of return'ing $this when setting vars in the model. I have seen this done in other places too but cant figure this out. Sample code: public function setAlias($Alias){ $this->_Alias = (string) $Alias; return $this; } public function getAlias(){ return $this->_Alias; }

    Read the article

  • 404 Not Found When Requesting URI With Encoded Patameters

    - by Richard Knop
    I am pretty sure this is some problem with the Apache configuration because it used to work on the previous hosting provider with the same PHP/MySQL configuration. In my application, users are able to delete photos by going to URIs like this: http://example.com/my-account/remove-media/id/9/ret/my-account%252Fedit-album%252Fid%252F1 The paramater id is an id of a photo to be removed, the parameter ret is a relative URL where user should be redirected after the removal of the photo but after clicking on a link like that I get 404 Not Found error with the text: Not Found The requested URL /public/my-account/remove-media/id/9/ret/my-account/edit-album/id/1 was not found on this server. Though it used to work on my previous hosting provider so I guess it is just some easy Apache configuration issue? One more thing, there is a htaccess file that changes the document root to /public: RewriteEngine On php_value upload_max_filesize 15M php_value post_max_size 15M php_value max_execution_time 200 php_value max_input_time 200 # Exclude some directories from URI rewriting #RewriteRule ^(dir1|dir2|dir3) - [L] RewriteRule ^\.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L] RewriteCond %{REQUEST_URI} !^/public/.*$ RewriteRule ^(.*)$ /public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L] RewriteRule ^public/.*$ /public/index.php [NC,L] In the public folder there is a second htaccess file for MVC: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L] # Turn off magic quotes #php_flag magic_quotes_gpc off

    Read the article

  • Zend_XmlRpc :Failed to parse response error

    - by davykiash
    Am trying to get a simple hello world XMLRPC server setup to work.However I get this Failed to parse response error error when I run the test URL http://localhost/client/index/ on my browser In my Rpc Controller that handles all my XMLRPC calls class RpcController extends Zend_Controller_Action { public function init() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); } public function xmlrpcAction() { $server = new Zend_XmlRpc_Server(); $server->setClass('Service_Rpctest','test'); $server->handle(); } } In my client Controller that calls the XMLRPC Server class ClientController extends Zend_Controller_Action { public function indexAction() { $clientrpc = new Zend_XmlRpc_Client('http://localhost/rpc/xmlrpc/'); //Render Output to the view $this->view->rpcvalue = $clientrpc->call('test.sayHello'); } } In my Service_Rpctest function <?php class Service_Rpctest { /** * Return the Hello String * * @return string */ public function sayHello() { $value = 'Hello'; return $value; } } What am I missing?

    Read the article

  • magento, making a grouped product show on sale based on product children prices

    - by thrice801
    Hi, Question regarding Magento and sale items. So I have to use grouped items to link multiple items which are the same style but different colors, these are the items I have showing on my search results/category pages. - I am trying to figure out how I can make the master sku, show as on sale, when the children items are marked on sale. I am able to make it show up on the product page, but anytime I have tried calling any of the getchildren methods outside of grouped.phtml, I have failed, horribly. I think I worked on that method for probably 36 hours unsuccessfully calling it from any other page. So, I thought I would ask here. Does anyone know how I could call the getchildskus or whatever it is method, from the category page, so that I can do something like, for each child product, compare sale price with active price, if there is a difference, calculate the percentage off, and display the largest difference as "ON SALE, UP TO 30% OFF!", or whatever it may be? Any help would be much appreciated. (oh, and I cant set a price on the main group sku, I sell sunglasses and watches mainly and many times a different color will differ in price quite significantly.)

    Read the article

  • Zend_Validate_Abstract custom validator not displaying correct error messages.

    - by Jeremy Dowell
    I have two text fields in a form that I need to make sure neither have empty values nor contain the same string. The custom validator that I wrote extends Zend_Validate_Abstract and works correctly in that it passes back the correct error messages. In this case either: isEmpty or isMatch. However, the documentation says to use addErrorMessages to define the correct error messages to be displayed. in this case, i have attached ->addErrorMessages(array("isEmpty"=>"foo", "isMatch"=>"bar")); to the form field. According to everything I've read, if I return "isEmpty" from isValid(), my error message should read "foo" and if i return "isMatch" then it should read "bar". This is not the case I'm running into though. If I return false from is valid, no matter what i set $this-_error() to be, my error message displays "foo", or whatever I have at index[0] of the error messages array. If I don't define errorMessages, then I just get the error code I passed back for the display and I get the proper one, depending on what I passed back. How do I catch the error code and display the correct error message in my form? The fix I have implemented, until I figure it out properly, is to pass back the full message as the errorcode from the custom validator. This will work in this instance, but the error message is specific to this page and doesn't really allow for re-use of code. Things I have already tried: I have already tried validator chaining so that my custom validator only checks for matches: ->setRequired("true") ->addValidator("NotEmpty") ->addErrorMessage("URL May Not Be Empty") ->addValidator([*customValidator]*) ->addErrorMessage("X and Y urls may not be the same") But again, if either throws an error, the last error message to be set displays, regardless of what the error truly is. I'm not entirely sure where to go from here. Any suggestions?

    Read the article

  • Cannot access new product attributes in grid display

    - by russjman
    I added a couple new attribute to my products(a boolean "yes/no" fields). They are variables to enable/disable the price from displaying on the product detail page, and grid view. I managed to get it work on the product info page. But on product grid page I cant seem to access those variable. Specifically, the template i am working with is catalog/product/list.phtml. Ive tried adding them in the xml file like this layout/catalog.xml: <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"> <action method="addAttribute"><name>DisplayPrice</name></action> <action method="addAttribute"><name>CustomOrder</name></action> </block> and I am trying to access the attributes like so in catalog/product/list.phtml: <?php echo $_product->getDisplayPriceName()? "Yes" : "No" ; echo $_product->getCustomOrderName()? "Yes" : "No" ;?> ive also added in the Mage config file app/code/core/Catalog/etc/config.xml: <frontend> <!---- stuff before this --> <product> <collection> <attributes> <name /> <url_key /> <price /> <special_price /> <custom_order /> <!--new attribute --> <display_price /> <!--new attribute --> <special_from_date /> <special_to_date /> <short_description /> <thumbnail /> <small_image /> <image_label /> <thumbnail_label /> <small_image_label /> <tax_class_id /> <status /> <news_from_date /> <news_to_date /> <created_at /> <updated_at /> </attributes> </collection> </product> </frontend> At this point im shooting in the dark. I dont know enough about the Magento backend to know where else i need to go or look. ANY feed back will be greatly appreciated. thanks in advance.

    Read the article

  • How to get the Video-ID of a just uploaded Youtube movie

    - by murze
    Hi, how can i get the video-id of a just uploaded Youtube movie? I'm using this code: $yt = new Zend_Gdata_YouTube($httpClient); // create a new Zend_Gdata_YouTube_VideoEntry object $myVideoEntry = new Zend_Gdata_YouTube_VideoEntry(); // create a new Zend_Gdata_App_MediaFileSource object $filesource = $yt->newMediaFileSource('mytestmovie.mov'); $filesource->setContentType('video/quicktime'); // set slug header $filesource->setSlug('mytestmovie.mov'); // add the filesource to the video entry $myVideoEntry->setMediaSource($filesource); $myVideoEntry->setVideoTitle('My Test Movie'); $myVideoEntry->setVideoDescription('My Test Movie'); $myVideoEntry->setVideoCategory('Comedy'); // Note that category must be a valid YouTube category ! // set keywords, please note that this must be a comma separated string // and that each keyword cannot contain whitespace $myVideoEntry->setVideoTags('cars, funny'); // upload URI for the currently authenticated user $uploadUrl = 'http://uploads.gdata.youtube.com/feeds/api/users/default/uploads'; // try to upload the video, catching a Zend_Gdata_App_HttpException if available // or just a regular Zend_Gdata_App_Exception try { $newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry'); } catch (Zend_Gdata_App_HttpException $httpException) { echo $httpException->getRawResponseBody(); } catch (Zend_Gdata_App_Exception $e) { echo $e->getMessage(); } I assume it 'll be a property of $newEntry but i can't seem to find it! Thanks!

    Read the article

  • SVN syncing fails with ZendStudio

    - by rashcroft
    Hi. When I try to sync with my SVN (I'm using unfuddle) through ZendStudio I get the following error: Some of selected resources were not committed. svn: Commit failed (details follow): svn: MKACTIVITY request failed on '/svn/test1234_a/!svn/act/58ae0e6d-2301-0010-8300-cb465553b788' svn: MKACTIVITY of '/svn/test1234_a/!svn/act/58ae0e6d-2301-0010-8300-cb465553b788': 400 Bad Request (http://test1234.unfuddle.com) I think this is some type of proxy error, but how can I fix this (using ZendStudio). Thanks.

    Read the article

  • doctrine behaviors , if i did it like this , would be correct ??

    - by tawfekov
    Hi , I am doing a web application in ZF + Doctrine 1.2.3 but i had an old database , it had pretty good structure so i think i can reverse engineer it with doctrine commad ./dcotrine generate-models-db , its amazing but i stopped when i wanted to use some doctrine behaviors like : searchable as an example , my question : if i went to my model and added these two lines : $this->actAs('Searchable', array( 'fields' => array('title', 'content') ) ); i am not sure if that enough and would work as expected , if you had any more tips about creating other behaviors like (versionable , i18n , sluggable or soft delete ) manually or reverse engineer it with doctrine behaviors , could you please list them

    Read the article

  • Zend_Auth using multiple tables

    - by Christian
    What I'm trying to do is use Zend_Auth for authentication with the issuing being that the 'identity' is stored in a different table then then 'credential.' I'm able to pass an array for the credential and the identity but when it comes to the actual tables I'm not able to get it to accept the array. It ignores the 2nd table name. I was wondering if anyone has ever made this work in this way without extending the Zend_Auth class or if I will need to do so. Thanks in advance.

    Read the article

  • ForceContext Queries method twice?

    - by azz0r
    Hello, I'm doing a per minute script, to output the xml that a server will read, I am used forceContext. <?php class My_Controller_Action_Helper_ForceContext extends Zend_Controller_Action_Helper_ContextSwitch { public function initContext($format = null) { $request = $this->getRequest(); $action = $request->getActionName(); $context = $this->getActionContexts($action); //check if this is the only context if(count($context) === 1) { $format = $context[0]; } return parent::initContext($format); } } class Video_PerMinuteController extends Zend_Controller_Action { function init() { $contextSwitch = $this->_helper->getHelper('ForceContext'); $contextSwitch->addActionContext('transaction', 'xml')->initContext(); In my method, it gets the current minute count, adds 1, then saves. So I can clearly see when its accessed more than once in a minute. If I comment out the second contextSwitch line, it only goes up 1, if Its not, it displays the xml page but adds 2 minutes (being called twice somehow). Any ideas?

    Read the article

  • Cannot get new product attribute in grid display

    - by russjman
    I added a new attribute to my products(a boolean "yes/no" field). It is a variable to enable/disable the price from displaying on the product detail page, and grid view. I managed to get it work on the product info page. But on product grid page I cant seem to access that variable. Specifically, the template i am working with is catalog/product/price.phtml. From what i can tell, the price is being displayed by the same group of if-statements on both the product detail page, and grid page. This has me confused because i cant find any code on that template to handle multiple products, just a bunch of nested if statements. this is how im attempting to access this new variable using $_displayPrice. on line 36 of catalog/product/price.html <?php $_product = $this->getProduct(); ?> <?php $_id = $_product->getId() ?> <?php $_displayPrice = $_product->getDisplayPrice() ? "Yes" : "No"; echo $_displayPrice;?> What has me further confused is that when display $_product-getData(), my new variable isn't anywhere among that data. thanks in advance

    Read the article

  • How to set labels inside textfields for username and password like facebook?

    - by NAVEED
    I have a login form for my website. This login form have two text fields, username and password. Currently I am placing labels(username, password) just before textfields. But now I want to removed these two labels and want to show text(username, password) inside textfield. When user focuses on these textfields then texts should be removed and user can enter his desired username and password. I have also noticed that when user open a login form then font color of text(username, password) populated in textfield(username, password) is of diffent color and when user start typing in that field then previous text is removed and new font color is black. How is it possible?

    Read the article

  • Get email address from OpenID provider (Janrain openid library)

    - by Moak
    When signing in to stackoverflow with google I get this message Stackoverflow.com is asking for some information from your Google Account [email protected] • Email address: [email protected] However on my site I can log in with openid but I can't ask for the email address. I get this message You are signing in to example.com with your Google Account [email protected] Also I'm finding it hard to know at what step I need to ask for it, here's some code where I think that step should be built into. /** * Authenticates the given OpenId identity. * Defined by Zend_Auth_Adapter_Interface. * * @throws Zend_Auth_Adapter_Exception If answering the authentication query is impossible * @return Zend_Auth_Result */ public function authenticate() { $id = $this->_id; $consumer = new Auth_OpenID_Consumer($this->_storage); if (!empty($id)) { $authRequest = $consumer->begin($id); if (is_null($authRequest)) { return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, $id, array("Authentication failed", 'Unknown error')); } if (Auth_OpenID::isFailure($authRequest)) { return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, $id, array("Authentication failed", "Could not redirect to server: " . $authRequest->message)); } $redirectUrl = $authRequest->redirectUrl($this->_root, $this->_returnTo); if (Auth_OpenID::isFailure($redirectUrl)) { return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, $id, array("Authentication failed", $redirectUrl->message)); } Zend_OpenId::redirect($redirectUrl); } else { $response = $consumer->complete(Zend_OpenId::selfUrl()); switch($response->status) { case Auth_OpenID_CANCEL: case Auth_OpenID_FAILURE: return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, null, array("Authentication failed. " . @$response->message)); break; case Auth_OpenID_SUCCESS: return $this->_constructSuccessfulResult($response); break; } } } It seems like such an obvious thing but I'm having a hard time googling and combing through the code just to find this. Thanks!

    Read the article

  • PHP Fatal error, trying to request method inside model multiple times

    - by Tom
    The error message [23-Mar-2010 08:36:16] PHP Fatal error: Cannot redeclare humanize() (previously declared in /Users/tmclssns/Sites/nadar/nadar/trunk/webapp/application/filer/models/Filer/Aggregate.php:133) in /Users/tmclssns/Sites/nadar/nadar/trunk/webapp/application/filer/models/Filer/Aggregate.php on line 133 I have a "Filer" model which contains several methods to generate graphs. Each method in there related to generating graphs has the suffix "Graph" in the method name. As we have some performance issues, I try to render the graphs in advance (using cron) instead of rendering them on each request. The code below is what I came up with: public function generategraphsAction() { $this->_helper->viewRenderer->setNoRender(); $config = Zend_Registry::get('config'); $id = $this->_getParam('filerid'); $filer = new Filer($id); $filer_methods = get_class_methods($filer); foreach ($filer_methods as $filer_method) { if (preg_match('/^(.*)Graph$/i', $filer_method, $matches)) { $path = $config->imaging_caching_dir . "/$id/{$matches[1]}.png"; $filer->$matches[0]($path); } } // var_dump(get_class_methods($filer)); die; } The result from the var_dump(), when uncommented, is: array 0 => string '__construct' (length=11) 1 => string 'find_by_name' (length=12) 2 => string 'getPartner' (length=10) 3 => string 'getSlots' (length=8) 4 => string 'getGroups' (length=9) 5 => string 'grouplist' (length=9) 6 => string 'getAggregates' (length=13) 7 => string 'getVolumes' (length=10) 8 => string 'getAggregateVolumes' (length=19) 9 => string 'getShelves' (length=10) 10 => string 'getAutoSupportHistory' (length=21) 11 => string 'getAutoSupportMail' (length=18) 12 => string 'getOrphans' (length=10) 13 => string 'getAll' (length=6) 14 => string 'getDiskRevOverview' (length=18) 15 => string 'getDiskTypeOverview' (length=19) 16 => string 'getDiskTypeSizeFunctionOverview' (length=31) 17 => string 'getLicenses' (length=11) 18 => string 'removeGroup' (length=11) 19 => string 'addGroup' (length=8) 20 => string 'hasGroup' (length=8) 21 => string 'aggdefaultGraph' (length=15) 22 => string 'aggbarGraph' (length=11) 23 => string 'voldefaultGraph' (length=15) 24 => string 'volbarGraph' (length=11) 25 => string 'replicationGraph' (length=16) 26 => string 'getReplicationData' (length=18) 27 => string 'humanize' (length=8) 28 => string 'getFiler' (length=8) 29 => string 'getOptions' (length=10) 30 => string 'getCifsInfo' (length=11) 31 => string 'getCifsStats' (length=12) 32 => string '__get' (length=5) 33 => string 'tr' (length=2) 34 => string 'trs' (length=3) 35 => string 'fieldList' (length=9) The generategraphsAction() method finds the 'Graph' methods correctly: array 0 => string 'aggdefaultGraph' (length=15) 1 => string 'aggdefault' (length=10) array 0 => string 'aggbarGraph' (length=11) 1 => string 'aggbar' (length=6) array 0 => string 'voldefaultGraph' (length=15) 1 => string 'voldefault' (length=10) array 0 => string 'volbarGraph' (length=11) 1 => string 'volbar' (length=6) array 0 => string 'replicationGraph' (length=16) 1 => string 'replication' (length=11) However when the first graph is generated, it generates the above listed PHP fatal error. Anyone can come up with a solution to this? I tried to pass by reference or switch a few things around (like re declare the Filer model, $current_filer = new Filer($id); and unset() it again after the request, but resulted in the same error) without much success. The referenced method "humanize" isn't used for anything I'm doing at the moment, but belongs to the Model because it's used in several other places. Of course, removing the method is not really an option right now, and the model contains several other methods as well so I assume if I just move the humanize method around, it will generate an error on the next one. For reference, the humanize() method: public function humanize ($kbytes, $unit = null) { // KiloByte, Megabyte, GigaByte, TeraByte, PetaByte, ExaByte, ZettaByte, YottaByte $units = array('KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); if (null !== $units) { $i = array_search(substr($unit, -2), $units); if (! $i) { $i = floor((strlen($kbytes) - 1) / 3); } } else { $i = floor((strlen($kbytes) - 1) / 3); } $newSize = round($kbytes / pow(1024, $i), 2); return $newSize . $units[$i]; } Thanks in advance for the help offered.

    Read the article

  • Ways to call Blocks within Magento: createBlock vs Layout xml file

    - by N. B.
    Context: I'm trying to include Adminhtml blocks in the frontend of the site to replace some of the user account blocks. The first thing I'm trying to do is simply display the block on the correct page. I can replace the entire page by setting the Body of the response inside the controller, but I'm having a hard time including the block in the layout xml file and then calling it within the template. Why would I be able to create an adminhtml/sales_order_grid from Mage_Sales_OrderController using createBlock: $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/sales_order_grid')->toHtml()); But not from a frontend layout, using a declaration <block type="adminhtml/sales_order_grid" name="orders_widget"/> within app/design/frontend/default/default/layout/sales.xml The latter produces an error without a stack trace: Fatal error: Call to a member function toHtml() on a non-object in app/code/core/Mage/Core/Model/Layout.php on line 526 Thanks for any guidance!

    Read the article

  • How can I query Google Spreadsheets API with a string value?

    - by ColinM
    I am using Zend_Gdata_SpreadsheetsListQuery. In PHP my query is: "confirmation=$confirmation" The problem is that $confirmation = 'AB-CD-EFG-012345'; Apparently the hyphens are causing problems with the query and the exception thrown is: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 Parse error: Invalid token encountered' How can I quote or escape the value to not cause parse errors? Single quotes cause the same error, double quotes don't throw errors but there are no results to match.

    Read the article

  • ZendFramework integration with other frameworks

    - by St.Woland
    I want to make this question a guide for those interested in ZendFramework integration with other libraries/frameworks. Searching over StackOverflow doesn't give a broad view on the subject. The question is: which libraries/frameworks do you use in your current ZF-based project? what are the best practices for ZF-based project architecture? I don't mean any components that are already a part of ZF. Please give a description of aditional frameworks you have integrated (like RuckUsing, Smarty, or Doctrine). It also applies to any GUI frameworks (perhaps you use a CSS framework), as well as JS frameworks (not just jQuery or prototype, but rather some advanced structures). The main requirement: it has to be a ZendFramework project. Additional bonus will be given to answers that describe performance optimization.

    Read the article

  • Structuring System Architecture in a Flex Web Application on a Budget (w/o Java)

    - by phwd
    I started a project a while back using the following architecture from Adobe Developer Article talking about Creating marketing platforms in Flex. I did my first set of coding locally forgetting that my server did not handle Tomcat. So I said okay, and cut some corners and then some other limitation came up and I cut some more corners. Eventually for a good week or two, it was trying to get the project working with making the ends meet. Layers started to merge. In the end I used a PureMVC (Presentation/Client) - ZendAMF (Communication) - MySql (Data) Layout. It worked but I never felt as though I had some layer just to take care of all the SQL calls to the data.It just felt hacked together So should I keep the above setup and just start from the presentation layer and move downwards like they said in the article or is there a better layering (based on a hosting plan that does not handle Java) I could accomplish ? NOTE: I would just ask the adobe guys but they barely reply on their site. Thanks !

    Read the article

  • Problem With View Helpers

    - by Richard Knop
    I wrote few custom view helpers but I have a little trouble using them. If I add the helper path in controller action like this: public function fooAction() { $this->view->addHelperPath('My/View/Helper', 'My_View_Helper'); } Then I can use the views from that path without a problem. But when I add the path in the bootstrap file like this: protected function _initView() { $this->view = new Zend_View(); $this->view->doctype('XHTML1_STRICT'); $this->view->headScript()->appendFile($this->view->baseUrl() . '/js/jquery-ui/jquery.js'); $this->view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8'); $this->view->headMeta()->appendHttpEquiv('Content-Style-Type', 'text/css'); $this->view->headMeta()->appendHttpEquiv('Content-Language', 'sk'); $this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/reset.css'); $this->view->addHelperPath('My/View/Helper', 'My_View_Helper'); } Then the view helpers don't work. Why is that? It's too troublesome to add the path in every controller action. Here is an example of how my custom view helpers look: class My_View_Helper_FooBar { public function fooBar() { return 'hello world'; } } I use them like this in views: <?php echo $this->fooBar(); ?> Should I post my whole bootstrap file? UPDATE: Added complete bootstrap file just in case: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initFrontController() { $this->frontController = Zend_Controller_Front::getInstance(); $this->frontController->addModuleDirectory(APPLICATION_PATH . '/modules'); Zend_Controller_Action_HelperBroker::addPath( 'My/Controller/Action/Helper', 'My_Controller_Action_Helper' ); $this->frontController->registerPlugin(new My_Controller_Plugin_Auth()); $this->frontController->setBaseUrl('/'); } protected function _initView() { $this->view = new Zend_View(); $this->view->doctype('XHTML1_STRICT'); $this->view->headScript()->appendFile($this->view->baseUrl() . '/js/jquery-ui/jquery.js'); $this->view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8'); $this->view->headMeta()->appendHttpEquiv('Content-Style-Type', 'text/css'); $this->view->headMeta()->appendHttpEquiv('Content-Language', 'sk'); $this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/reset.css'); $this->view->addHelperPath('My/View/Helper', 'My_View_Helper'); } protected function _initDb() { $this->configuration = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENVIRONMENT); $this->dbAdapter = Zend_Db::factory($this->configuration->database); Zend_Db_Table_Abstract::setDefaultAdapter($this->dbAdapter); $stmt = new Zend_Db_Statement_Pdo($this->dbAdapter, "SET NAMES 'utf8'"); $stmt->execute(); } protected function _initAuth() { $this->auth = Zend_Auth::getInstance(); } protected function _initCache() { $frontend= array('lifetime' => 7200, 'automatic_serialization' => true); $backend= array('cache_dir' => 'cache'); $this->cache = Zend_Cache::factory('core', 'File', $frontend, $backend); } public function _initTranslate() { $this->translate = new Zend_Translate('Array', BASE_PATH . '/languages/Slovak.php', 'sk_SK'); $this->translate->setLocale('sk_SK'); } protected function _initRegistry() { $this->registry = Zend_Registry::getInstance(); $this->registry->configuration = $this->configuration; $this->registry->dbAdapter = $this->dbAdapter; $this->registry->auth = $this->auth; $this->registry->cache = $this->cache; $this->registry->Zend_Translate = $this->translate; } protected function _initUnset() { unset($this->frontController, $this->view, $this->configuration, $this->dbAdapter, $this->auth, $this->cache, $this->translate, $this->registry); } protected function _initGetRidOfMagicQuotes() { if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); $_REQUEST = array_map('stripslashes_deep', $_REQUEST); } } public function run() { $frontController = Zend_Controller_Front::getInstance(); $frontController->dispatch(); } }

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >