I am trying to implement the canonical url and to combine with custom route classes. URL-SACAME is something like this: / category-x / article / 123 / category-y / article / 123 I am creating a custom route - the expansion of the class Zend_Controller_Router_Route_Regex and checks that the article is 123 and the correct category-name is included in the URL. If the article is in 123 square-X and the user is reaching square-y, then I want to redirect to the correct URL. But there is no clear possibility to do this directly to the roads. What is the best practice approach here? I often do this in my action controller like something ... // Get / Category-Y / Article / 123 $ $ article- & gt; URL is generated, and it contains / category-x / article / 123 if (this-> --request-> getRequestUri ()! = $ Article-> URL) {return $ this- & gt; ; _helper-> Redirector-> GoToUrl ($ paragraph-> url); } In this example, $ article-> The url will need ...
I have developed an extension which works up to 1.6 on Magren (I'm trying Enterprise Edition, And I think the community is the same problem, because it is the same code). In my install script, I see the $ installer-> gt; CreateEntityTables ($ this- & gt; getTable ('alphanum / info')); The installation is done until it is not in the _text unit table. It crashed there! It turns out that when I log in to SQL and run it via PHPmyadmin, then this error is: Blob / Text column 'value' is used without the key 'key' . I saw the code there, and this is what is trying to create an index on the value column: -> addIndex ($ this- & gt; getIdxName ($ eavTableName, array ( 'attribute_id array (' attribute_id ',' value ')) - & gt; addIndex ($ this- & gt; getIdxName ($ eavTableName, array (' entity_type_id ' , 'Value')), array ('entity_type_id', 'value')) If there is no if statement is n...
I can do $ conn from within my function such as: function Xyz ($ A) {global $ conn; ....} I am thinking that this is a way of doing a class before. class abc {global $ conn; Public function xyz ($ a) {$ conn- & gt; Execute ...} public function xya ($ a) {$ conn- & gt; Execute ...}} The above method gives me an error I know that I can get it this way: class ABC {Public Function xyz ($ a) {global $ conn; $ Conn- & gt; Execute ...} Public Function xya ($ a) {global $ conn; $ Conn- & gt; Execute ...}} I hope you can understand what I mean. Thanks in advance for the help. Your second example is possible, your first is not. There is no such thing as a member of a class variable that is a global variable, or the use of scope like yours is your first example. Generally, however, I would advise to avoid global use. Keyword I absolutely do a lot of PHP programming and have never used it in serious (actually, nothing in the last 10 or so years). . If you ...
Comments
Post a Comment